From d811e47f273ce6bfba18e77ea0a2bb88f9fdbdea Mon Sep 17 00:00:00 2001
From: Brian DiChiara
Date: Tue, 14 Jan 2025 17:39:08 -0600
Subject: [PATCH] [N/A] Remove plugins moved to separate repo
---
.github/workflows/deploy.yaml | 9 -
.../ProjectEvents/PostInstallScript.php | 1 -
.../viget-blocks-toolkit/.editorconfig | 27 -
.../plugins/viget-blocks-toolkit/.phpcs.xml | 153 -
.../plugins/viget-blocks-toolkit/README.md | 109 -
.../viget-blocks-toolkit/assets/css/admin.css | 3 -
.../viget-blocks-toolkit/assets/icons.json | 122 -
.../build/editor.asset.php | 1 -
.../viget-blocks-toolkit/build/editor.css | 1 -
.../build/index.asset.php | 1 -
.../viget-blocks-toolkit/build/index.js | 1 -
.../build/style.asset.php | 1 -
.../viget-blocks-toolkit/build/style.css | 1 -
.../viget-blocks-toolkit/includes/assets.php | 69 -
.../viget-blocks-toolkit/includes/helpers.php | 443 -
.../includes/parts-kit.php | 215 -
.../viget-blocks-toolkit/includes/timber.php | 30 -
.../viget-blocks-toolkit/package-lock.json | 26526 ---
.../plugins/viget-blocks-toolkit/package.json | 32 -
.../viget-blocks-toolkit/prettier.config.js | 22 -
.../src/classes/BlockIcons.php | 464 -
.../src/classes/BlockRegistration.php | 601 -
.../src/classes/BlockTemplate/Block.php | 190 -
.../src/classes/BlockTemplate/Template.php | 75 -
.../src/classes/BreakpointVisibility.php | 129 -
.../viget-blocks-toolkit/src/classes/Core.php | 62 -
.../src/classes/Settings.php | 166 -
.../viget-blocks-toolkit/src/editor.scss | 82 -
.../src/features/block-icons.js | 167 -
.../src/features/block-styles.js | 24 -
.../src/features/block-variations.js | 24 -
.../src/features/breakpoint-visibility.js | 222 -
.../src/features/media-position.js | 177 -
.../plugins/viget-blocks-toolkit/src/index.js | 18 -
.../viget-blocks-toolkit/src/index.scss | 96 -
.../viget-blocks-toolkit/views/default.php | 24 -
.../viget-blocks-toolkit/views/jsx.php | 52 -
.../viget-blocks-toolkit.php | 54 -
.../viget-blocks-toolkit/webpack.config.js | 21 -
.../plugins/viget-form-blocks/.editorconfig | 27 -
.../plugins/viget-form-blocks/.phpcs.xml | 153 -
.../plugins/viget-form-blocks/README.md | 3 -
.../acf-json/acf-export-2025-01-05.json | 1843 -
.../viget-form-blocks/assets/css/admin.css | 104 -
.../viget-form-blocks/assets/js/admin.js | 29 -
.../assets/js/conditional-logic.js | 22 -
.../js/third-party/mf-conditional-fields.js | 643 -
.../third-party/mf-conditional-fields.min.js | 2 -
.../blocks/all-fields/block.json | 16 -
.../blocks/all-fields/block.php | 11 -
.../blocks/all-fields/render.php | 13 -
.../blocks/checkbox/block.json | 29 -
.../blocks/checkbox/group_66903c8f9103f.json | 73 -
.../blocks/checkbox/render.php | 31 -
.../blocks/checkbox/style.css | 12 -
.../blocks/fieldset/block.json | 214 -
.../blocks/fieldset/render.php | 29 -
.../blocks/fieldset/style.css | 21 -
.../blocks/form-data/block.json | 18 -
.../blocks/form-data/block.php | 11 -
.../blocks/form-data/editor.css | 5 -
.../blocks/form-data/group_669ea8d6ef54a.json | 90 -
.../blocks/form-data/render.php | 58 -
.../blocks/form-meta/block.json | 18 -
.../blocks/form-meta/block.php | 11 -
.../blocks/form-meta/editor.css | 5 -
.../blocks/form-meta/group_66a7b9112a9b3.json | 90 -
.../blocks/form-meta/render.php | 58 -
.../viget-form-blocks/blocks/form/block.json | 29 -
.../viget-form-blocks/blocks/form/block.php | 11 -
.../viget-form-blocks/blocks/form/editor.css | 83 -
.../blocks/form/group_668327fbcea85.json | 465 -
.../viget-form-blocks/blocks/form/render.php | 34 -
.../viget-form-blocks/blocks/form/style.css | 80 -
.../viget-form-blocks/blocks/input/block.json | 149 -
.../blocks/input/group_66832bf2f293a.json | 228 -
.../viget-form-blocks/blocks/input/render.php | 31 -
.../viget-form-blocks/blocks/input/style.css | 10 -
.../viget-form-blocks/blocks/label/block.json | 28 -
.../viget-form-blocks/blocks/label/render.php | 37 -
.../viget-form-blocks/blocks/label/style.css | 13 -
.../blocks/legend/block.json | 27 -
.../blocks/legend/render.php | 37 -
.../blocks/radios/block.json | 33 -
.../blocks/radios/render.php | 54 -
.../viget-form-blocks/blocks/radios/style.css | 27 -
.../blocks/select/block.json | 29 -
.../blocks/select/editor.css | 52 -
.../blocks/select/group_66970a1373563.json | 45 -
.../blocks/select/render.php | 45 -
.../blocks/submit/block.json | 26 -
.../viget-form-blocks/blocks/submit/block.php | 11 -
.../blocks/submit/render.php | 27 -
.../blocks/textarea/block.json | 32 -
.../blocks/textarea/render.php | 26 -
.../classes/Admin/EmailTemplate.php | 498 -
.../classes/Admin/Integration.php | 723 -
.../classes/Admin/Submission.php | 469 -
.../classes/Blocks/AllFieldsBlock.php | 48 -
.../classes/Blocks/Block.php | 232 -
.../classes/Blocks/FormBlock.php | 33 -
.../classes/Blocks/FormDataBlock.php | 48 -
.../classes/Blocks/FormMetaBlock.php | 48 -
.../classes/Blocks/SubmitBlock.php | 37 -
.../classes/Confirmation.php | 145 -
.../classes/Elements/Checkbox.php | 70 -
.../classes/Elements/Color.php | 22 -
.../classes/Elements/Field.php | 687 -
.../classes/Elements/Fieldset.php | 149 -
.../classes/Elements/File.php | 102 -
.../classes/Elements/Form.php | 487 -
.../classes/Elements/Input.php | 115 -
.../classes/Elements/Label.php | 45 -
.../classes/Elements/Legend.php | 40 -
.../classes/Elements/Number.php | 50 -
.../classes/Elements/Radios.php | 71 -
.../classes/Elements/Select.php | 94 -
.../classes/Elements/Textarea.php | 53 -
.../viget-form-blocks/classes/Form.php | 652 -
.../classes/Integrations/Integration.php | 120 -
.../classes/Integrations/Request.php | 178 -
.../classes/Meta/Confirmation.php | 62 -
.../viget-form-blocks/classes/Meta/Form.php | 67 -
.../viget-form-blocks/classes/Meta/IP.php | 53 -
.../viget-form-blocks/classes/Meta/Meta.php | 226 -
.../classes/Meta/Notifications.php | 82 -
.../viget-form-blocks/classes/Meta/PostID.php | 54 -
.../classes/Meta/RequestMethod.php | 55 -
.../viget-form-blocks/classes/Meta/URL.php | 53 -
.../classes/Meta/UserAgent.php | 53 -
.../classes/Notification.php | 313 -
.../viget-form-blocks/classes/Submission.php | 312 -
.../classes/Traits/AdminPostType.php | 206 -
.../classes/Traits/ChildFields.php | 49 -
.../classes/Traits/Options.php | 47 -
.../classes/Utilities/Blocks.php | 115 -
.../classes/Utilities/Cache.php | 55 -
.../viget-form-blocks/classes/Validation.php | 127 -
.../viget-form-blocks/classes/Views.php | 58 -
.../plugins/viget-form-blocks/composer.json | 25 -
.../plugins/viget-form-blocks/composer.lock | 18 -
.../viget-form-blocks/includes/assets.php | 61 -
.../includes/block-fields.php | 1467 -
.../includes/conditional-logic.php | 37 -
.../viget-form-blocks/includes/helpers.php | 47 -
.../viget-form-blocks/includes/post-types.php | 14 -
.../includes/registration.php | 54 -
.../views/parts/email-footer.php | 16 -
.../views/parts/email-header.php | 23 -
.../views/templates/all-fields.php | 34 -
.../views/templates/form-data/default.php | 38 -
.../views/templates/form-meta/default.php | 56 -
.../viget-form-blocks/viget-form-blocks.php | 41 -
.../plugins/viget-parts-kit/.editorconfig | 27 -
wp-content/plugins/viget-parts-kit/.eslintrc | 5 -
wp-content/plugins/viget-parts-kit/.phpcs.xml | 153 -
.../plugins/viget-parts-kit/.prettierrc.js | 3 -
.../plugins/viget-parts-kit/.wp-env.json | 5 -
.../plugins/viget-parts-kit/babel.config.js | 18 -
.../plugins/viget-parts-kit/build/core.css | 17369 --
.../build/isolated-block-editor-builtin.js | 114659 -----------
.../build/isolated-block-editor.css | 8 -
.../build/isolated-block-editor.js | 154807 ---------------
.../isolated-block-editor.js.LICENSE.txt | 147 -
.../plugins/viget-parts-kit/package-lock.json | 39566 ----
.../plugins/viget-parts-kit/package.json | 68 -
.../viget-parts-kit/prettier.config.js | 22 -
.../viget-parts-kit/src/browser/README.md | 11 -
.../viget-parts-kit/src/browser/core.js | 4 -
.../viget-parts-kit/src/browser/core.scss | 8 -
.../viget-parts-kit/src/browser/index.html | 90 -
.../viget-parts-kit/src/browser/index.js | 116 -
.../src/browser/plain-text-editor.png | Bin 139606 -> 0 bytes
.../viget-parts-kit/src/browser/style.scss | 6 -
.../src/classes/BlockParts.php | 103 -
.../viget-parts-kit/src/classes/PartsKit.php | 374 -
.../src/classes/WPGutenberg.php | 284 -
.../plugins/viget-parts-kit/views/block.php | 112 -
.../plugins/viget-parts-kit/views/editor.php | 52 -
.../viget-parts-kit/views/parts-kit.php | 20 -
.../viget-parts-kit/viget-parts-kit.php | 43 -
.../plugins/viget-parts-kit/webpack.config.js | 81 -
182 files changed, 373018 deletions(-)
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/.editorconfig
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/.phpcs.xml
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/README.md
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/assets/css/admin.css
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/assets/icons.json
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/build/editor.asset.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/build/editor.css
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/build/index.asset.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/build/index.js
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/build/style.asset.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/build/style.css
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/includes/assets.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/includes/helpers.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/includes/parts-kit.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/includes/timber.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/package-lock.json
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/package.json
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/prettier.config.js
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/classes/BlockIcons.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/classes/BlockRegistration.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/classes/BlockTemplate/Block.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/classes/BlockTemplate/Template.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/classes/BreakpointVisibility.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/classes/Core.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/classes/Settings.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/editor.scss
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/features/block-icons.js
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/features/block-styles.js
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/features/block-variations.js
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/features/breakpoint-visibility.js
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/features/media-position.js
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/index.js
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/src/index.scss
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/views/default.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/views/jsx.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/viget-blocks-toolkit.php
delete mode 100644 wp-content/plugins/viget-blocks-toolkit/webpack.config.js
delete mode 100644 wp-content/plugins/viget-form-blocks/.editorconfig
delete mode 100644 wp-content/plugins/viget-form-blocks/.phpcs.xml
delete mode 100644 wp-content/plugins/viget-form-blocks/README.md
delete mode 100644 wp-content/plugins/viget-form-blocks/acf-json/acf-export-2025-01-05.json
delete mode 100644 wp-content/plugins/viget-form-blocks/assets/css/admin.css
delete mode 100644 wp-content/plugins/viget-form-blocks/assets/js/admin.js
delete mode 100644 wp-content/plugins/viget-form-blocks/assets/js/conditional-logic.js
delete mode 100644 wp-content/plugins/viget-form-blocks/assets/js/third-party/mf-conditional-fields.js
delete mode 100644 wp-content/plugins/viget-form-blocks/assets/js/third-party/mf-conditional-fields.min.js
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/all-fields/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/all-fields/block.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/all-fields/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/checkbox/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/checkbox/group_66903c8f9103f.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/checkbox/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/checkbox/style.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/fieldset/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/fieldset/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/fieldset/style.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-data/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-data/block.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-data/editor.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-data/group_669ea8d6ef54a.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-data/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-meta/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-meta/block.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-meta/editor.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-meta/group_66a7b9112a9b3.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form-meta/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form/block.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form/editor.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form/group_668327fbcea85.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/form/style.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/input/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/input/group_66832bf2f293a.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/input/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/input/style.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/label/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/label/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/label/style.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/legend/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/legend/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/radios/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/radios/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/radios/style.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/select/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/select/editor.css
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/select/group_66970a1373563.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/select/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/submit/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/submit/block.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/submit/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/textarea/block.json
delete mode 100644 wp-content/plugins/viget-form-blocks/blocks/textarea/render.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Admin/EmailTemplate.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Admin/Integration.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Admin/Submission.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Blocks/AllFieldsBlock.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Blocks/Block.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Blocks/FormBlock.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Blocks/FormDataBlock.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Blocks/FormMetaBlock.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Blocks/SubmitBlock.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Confirmation.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Checkbox.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Color.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Field.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Fieldset.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/File.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Form.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Input.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Label.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Legend.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Number.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Radios.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Select.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Elements/Textarea.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Form.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Integrations/Integration.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Integrations/Request.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Meta/Confirmation.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Meta/Form.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Meta/IP.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Meta/Meta.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Meta/Notifications.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Meta/PostID.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Meta/RequestMethod.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Meta/URL.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Meta/UserAgent.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Notification.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Submission.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Traits/AdminPostType.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Traits/ChildFields.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Traits/Options.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Utilities/Blocks.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Utilities/Cache.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Validation.php
delete mode 100644 wp-content/plugins/viget-form-blocks/classes/Views.php
delete mode 100644 wp-content/plugins/viget-form-blocks/composer.json
delete mode 100644 wp-content/plugins/viget-form-blocks/composer.lock
delete mode 100644 wp-content/plugins/viget-form-blocks/includes/assets.php
delete mode 100644 wp-content/plugins/viget-form-blocks/includes/block-fields.php
delete mode 100644 wp-content/plugins/viget-form-blocks/includes/conditional-logic.php
delete mode 100644 wp-content/plugins/viget-form-blocks/includes/helpers.php
delete mode 100644 wp-content/plugins/viget-form-blocks/includes/post-types.php
delete mode 100644 wp-content/plugins/viget-form-blocks/includes/registration.php
delete mode 100644 wp-content/plugins/viget-form-blocks/views/parts/email-footer.php
delete mode 100644 wp-content/plugins/viget-form-blocks/views/parts/email-header.php
delete mode 100644 wp-content/plugins/viget-form-blocks/views/templates/all-fields.php
delete mode 100644 wp-content/plugins/viget-form-blocks/views/templates/form-data/default.php
delete mode 100644 wp-content/plugins/viget-form-blocks/views/templates/form-meta/default.php
delete mode 100644 wp-content/plugins/viget-form-blocks/viget-form-blocks.php
delete mode 100644 wp-content/plugins/viget-parts-kit/.editorconfig
delete mode 100644 wp-content/plugins/viget-parts-kit/.eslintrc
delete mode 100644 wp-content/plugins/viget-parts-kit/.phpcs.xml
delete mode 100644 wp-content/plugins/viget-parts-kit/.prettierrc.js
delete mode 100644 wp-content/plugins/viget-parts-kit/.wp-env.json
delete mode 100644 wp-content/plugins/viget-parts-kit/babel.config.js
delete mode 100644 wp-content/plugins/viget-parts-kit/build/core.css
delete mode 100644 wp-content/plugins/viget-parts-kit/build/isolated-block-editor-builtin.js
delete mode 100644 wp-content/plugins/viget-parts-kit/build/isolated-block-editor.css
delete mode 100644 wp-content/plugins/viget-parts-kit/build/isolated-block-editor.js
delete mode 100644 wp-content/plugins/viget-parts-kit/build/isolated-block-editor.js.LICENSE.txt
delete mode 100644 wp-content/plugins/viget-parts-kit/package-lock.json
delete mode 100644 wp-content/plugins/viget-parts-kit/package.json
delete mode 100644 wp-content/plugins/viget-parts-kit/prettier.config.js
delete mode 100644 wp-content/plugins/viget-parts-kit/src/browser/README.md
delete mode 100644 wp-content/plugins/viget-parts-kit/src/browser/core.js
delete mode 100644 wp-content/plugins/viget-parts-kit/src/browser/core.scss
delete mode 100644 wp-content/plugins/viget-parts-kit/src/browser/index.html
delete mode 100644 wp-content/plugins/viget-parts-kit/src/browser/index.js
delete mode 100644 wp-content/plugins/viget-parts-kit/src/browser/plain-text-editor.png
delete mode 100644 wp-content/plugins/viget-parts-kit/src/browser/style.scss
delete mode 100644 wp-content/plugins/viget-parts-kit/src/classes/BlockParts.php
delete mode 100644 wp-content/plugins/viget-parts-kit/src/classes/PartsKit.php
delete mode 100644 wp-content/plugins/viget-parts-kit/src/classes/WPGutenberg.php
delete mode 100644 wp-content/plugins/viget-parts-kit/views/block.php
delete mode 100644 wp-content/plugins/viget-parts-kit/views/editor.php
delete mode 100644 wp-content/plugins/viget-parts-kit/views/parts-kit.php
delete mode 100644 wp-content/plugins/viget-parts-kit/viget-parts-kit.php
delete mode 100644 wp-content/plugins/viget-parts-kit/webpack.config.js
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml
index df655f00..f1e3b0a6 100644
--- a/.github/workflows/deploy.yaml
+++ b/.github/workflows/deploy.yaml
@@ -63,13 +63,6 @@ jobs:
args: '--optimize-autoloader'
working_dir: wp-content/mu-plugins/viget-wp
- # Build ACF plugin
- - name: Build ACF plugin
- run: |
- npm ci
- npm run build
- working-directory: wp-content/plugins/viget-blocks-toolkit
-
# Deploy code
- name: Deploy Starter
run: |
@@ -79,7 +72,6 @@ jobs:
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/themes/wp-starter &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/mu-plugins/viget-wp &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/mu-plugins/viget-wp.php &&\
- sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/plugins/viget-blocks-toolkit &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/plugins/safe-svg &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/plugins/advanced-custom-fields-pro"
rsync -rlptzv --exclude="node_modules" ./wp-content/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_TARGET }}:${{ secrets.APP_PATH }}/wp-content/
@@ -95,7 +87,6 @@ jobs:
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/themes/wp-starter &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/mu-plugins/viget-wp &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/mu-plugins/viget-wp.php &&\
- sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/plugins/viget-blocks-toolkit &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/plugins/safe-svg &&\
sudo rm -rf ${{ secrets.APP_PATH }}/wp-content/plugins/advanced-custom-fields-pro"
rsync -rlptzv --exclude="node_modules" ./wp-content/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_KIT_TARGET }}:${{ secrets.APP_PATH }}/wp-content/
diff --git a/bin/composer-scripts/ProjectEvents/PostInstallScript.php b/bin/composer-scripts/ProjectEvents/PostInstallScript.php
index 041171aa..81c0efba 100644
--- a/bin/composer-scripts/ProjectEvents/PostInstallScript.php
+++ b/bin/composer-scripts/ProjectEvents/PostInstallScript.php
@@ -64,7 +64,6 @@ class PostInstallScript extends ComposerScript {
],
'seo-by-rank-math' => 'Rank Math SEO',
'safe-svg' => 'Safe SVG',
- 'viget-parts-kit' => 'Viget Parts Kit',
];
/**
diff --git a/wp-content/plugins/viget-blocks-toolkit/.editorconfig b/wp-content/plugins/viget-blocks-toolkit/.editorconfig
deleted file mode 100644
index bb372724..00000000
--- a/wp-content/plugins/viget-blocks-toolkit/.editorconfig
+++ /dev/null
@@ -1,27 +0,0 @@
-# This file is for unifying the coding style for different editors and IDEs
-# It is based on https://core.trac.wordpress.org/browser/trunk/.editorconfig
-# See https://editorconfig.org for more information about the standard.
-# WordPress VIP documentation: https://docs.wpvip.com/technical-references/vip-codebase/editorconfig/
-
-# WordPress Coding Standards
-# https://make.wordpress.org/core/handbook/coding-standards/
-
-root = true
-
-[*]
-charset = utf-8
-end_of_line = lf
-insert_final_newline = true
-trim_trailing_whitespace = true
-indent_style = tab
-indent_size = 4
-
-[{*.yml,*.json}]
-indent_style = space
-indent_size = 2
-
-[*.md]
-trim_trailing_whitespace = false
-
-[*.txt]
-end_of_line = crlf
diff --git a/wp-content/plugins/viget-blocks-toolkit/.phpcs.xml b/wp-content/plugins/viget-blocks-toolkit/.phpcs.xml
deleted file mode 100644
index 68e6de9c..00000000
--- a/wp-content/plugins/viget-blocks-toolkit/.phpcs.xml
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
- A custom set of rules to check for a WPized WordPress project
-
-
-
- .
-
-
- /docroot/wp-admin/*
- /docroot/wp-includes/*
- /docroot/wp-*.php
- /docroot/index.php
- /docroot/xmlrpc.php
- /docroot/wp-content/plugins/*
-
-
- /vendor/*
-
-
- /node_modules/*
-
-
- *.min.js
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /path/to/Tests/*Test\.php
-
-
- /path/to/Tests/*Test\.php
-
-
-
diff --git a/wp-content/plugins/viget-blocks-toolkit/README.md b/wp-content/plugins/viget-blocks-toolkit/README.md
deleted file mode 100644
index cc5b2c2e..00000000
--- a/wp-content/plugins/viget-blocks-toolkit/README.md
+++ /dev/null
@@ -1,109 +0,0 @@
-# Viget Blocks Toolkit
-
-This is a toolkit for creating custom blocks with ACF Pro. It provides a simple way to create blocks with ACF Pro.
-
-This toolkit also includes a feature that adds icons to buttons.
-
-## Creating Custom Blocks in your Theme
-
-To create a block in your theme, simply create a `blocks` folder in the root of your theme directory. Each block should have its own folder and a `block.json` file. The `block.json` file should contain the block configuration. You can then use a `render.php` file or `render.twig` file to render the block.
-
-## Hooks
-
-### `vgtbt_block_locations` (Filter)
-
-Filter the block locations. This allows you to add or change where custom blocks can be found.
-
-```php
- __( 'My Custom Icon', 'my-text-domain' ),
- 'icon' => '',
- 'defaultLeft' => false, // Optional, defaults icon to align left.
- ];
-
- return $icons;
- }
-);
-```
-
-### `vgtbt_supported_icon_blocks` (Filter)
-
-Filter the supported icon blocks. Note: the frontend and editor CSS may need to be manually added for additional blocks.
-
-```php
-<\/polygon><\/svg>",
- "defaultLeft": true
- },
- {
- "label": "Arrow Right",
- "value": "arrow-right",
- "icon": "
',
- esc_html__( 'Select a form and field to see preview.', 'viget-form-blocks' )
- );
- return;
-}
-
-$form = Form::find_form( $form_id );
-$field = $form?->get_form_object()->get_field_by_id( $form_field );
-
-$show_label = get_field( 'show_label' );
-$show_value = get_field( 'show_value' );
-
-$template = ( new Template(
- new Block(
- 'core/paragraph',
- [ 'placeholder' => $field?->get_label() ?? __( 'Field Label...', 'viget-form-blocks' ) ]
- ),
-) )->get();
-?>
->
-
-
diff --git a/wp-content/plugins/viget-form-blocks/blocks/form-meta/block.json b/wp-content/plugins/viget-form-blocks/blocks/form-meta/block.json
deleted file mode 100644
index 27a83451..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/form-meta/block.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "form-meta",
- "title": "Form Meta",
- "description": "Display meta from a form",
- "icon": "database",
- "category": "form-data",
- "textdomain": "viget-form-blocks",
- "keywords": ["submission", "contact", "email", "field", "value", "fields", "form", "info"],
- "supports": {
- "jsx": true,
- "mode": false,
- "alignWide": true
- },
- "editorStyle": "file:./editor.css",
- "acf": {
- "mode": "preview"
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/form-meta/block.php b/wp-content/plugins/viget-form-blocks/blocks/form-meta/block.php
deleted file mode 100644
index 7fb91d17..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/form-meta/block.php
+++ /dev/null
@@ -1,11 +0,0 @@
- label {
- display: flex;
- gap: 0.5rem;
- flex-wrap: wrap;
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/form-meta/group_66a7b9112a9b3.json b/wp-content/plugins/viget-form-blocks/blocks/form-meta/group_66a7b9112a9b3.json
deleted file mode 100644
index 1f468964..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/form-meta/group_66a7b9112a9b3.json
+++ /dev/null
@@ -1,90 +0,0 @@
-{
- "key": "group_66a7b9112a9b3",
- "title": "Block: Form Meta",
- "fields": [
- {
- "key": "field_66a7b91132f2d",
- "label": "Meta Field",
- "name": "meta_field",
- "aria-label": "",
- "type": "select",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "choices": [
- "Select Meta"
- ],
- "default_value": 0,
- "return_format": "value",
- "multiple": 0,
- "allow_null": 0,
- "ui": 0,
- "ajax": 0,
- "placeholder": ""
- },
- {
- "key": "field_66a7b91133327",
- "label": "Label",
- "name": "show_label",
- "aria-label": "",
- "type": "true_false",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "message": "",
- "default_value": 1,
- "ui_on_text": "Show",
- "ui_off_text": "Hide",
- "ui": 1
- },
- {
- "key": "field_66a7b9113370e",
- "label": "Value",
- "name": "show_value",
- "aria-label": "",
- "type": "true_false",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "message": "",
- "default_value": 1,
- "ui_on_text": "Show",
- "ui_off_text": "Hide",
- "ui": 1
- }
- ],
- "location": [
- [
- {
- "param": "block",
- "operator": "==",
- "value": "acf\/form-meta"
- }
- ]
- ],
- "menu_order": 0,
- "position": "normal",
- "style": "default",
- "label_placement": "top",
- "instruction_placement": "label",
- "hide_on_screen": "",
- "active": true,
- "description": "",
- "show_in_rest": 0,
- "modified": 1722267959
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/form-meta/render.php b/wp-content/plugins/viget-form-blocks/blocks/form-meta/render.php
deleted file mode 100644
index 90e3382b..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/form-meta/render.php
+++ /dev/null
@@ -1,58 +0,0 @@
-%s',
- esc_html__( 'Select a form and meta field to see preview.', 'viget-form-blocks' )
- );
- return;
-}
-
-$form = Form::find_form( $form_id );
-$meta = $form?->get_meta_field( $meta_field );
-
-$show_label = get_field( 'show_label' );
-$show_value = get_field( 'show_value' );
-
-$template = ( new Template(
- new Block(
- 'core/paragraph',
- [ 'placeholder' => $meta->get_label() ?? __( 'Field Label...', 'viget-form-blocks' ) ]
- ),
-) )->get();
-?>
->
-
-
diff --git a/wp-content/plugins/viget-form-blocks/blocks/form/block.json b/wp-content/plugins/viget-form-blocks/blocks/form/block.json
deleted file mode 100644
index c1b93b3a..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/form/block.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "form",
- "title": "Form",
- "description": "Wrapper for forms.",
- "icon": "feedback",
- "category": "forms",
- "textdomain": "viget-form-blocks",
- "keywords": ["input", "contact", "feedback", "input"],
- "supports": {
- "jsx": true,
- "mode": false,
- "alignWide": true,
- "anchor": true
- },
- "editorStyle": "file:./editor.css",
- "style": "file:./style.css",
- "attributes": {
- "blockId": {
- "type": "string",
- "default": ""
- }
- },
- "providesContext": {
- "acffb/formId": "blockId"
- },
- "acf": {
- "mode": "preview"
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/form/block.php b/wp-content/plugins/viget-form-blocks/blocks/form/block.php
deleted file mode 100644
index c1a3d12c..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/form/block.php
+++ /dev/null
@@ -1,11 +0,0 @@
- label > .acf-innerblocks-container {
- display: flex;
- flex-wrap: wrap;
- gap: 0.25rem;
-}
-.acf-block-form .form-input > label > .acf-innerblocks-container:has(.block-list-appender) {
- padding-right: 1.75rem;
-}
-
-.acf-block-form > .acf-innerblocks-container > *:not(:last-child) {
- margin-bottom: 1.75rem;
-}
-
-.acf-block-form select,
-.acf-block-form input[type=file] {
- pointer-events: none;
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/form/group_668327fbcea85.json b/wp-content/plugins/viget-form-blocks/blocks/form/group_668327fbcea85.json
deleted file mode 100644
index 9916f4c0..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/form/group_668327fbcea85.json
+++ /dev/null
@@ -1,465 +0,0 @@
-{
- "key": "group_668327fbcea85",
- "title": "Block: Form",
- "fields": [
- {
- "key": "field_6684014a8bd1f",
- "label": "Form Settings",
- "name": "",
- "aria-label": "",
- "type": "accordion",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "open": 1,
- "multi_expand": 1,
- "endpoint": 0
- },
- {
- "key": "field_668327fcca5b6",
- "label": "Form Method",
- "name": "method",
- "aria-label": "",
- "type": "button_group",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "choices": {
- "POST": "POST",
- "GET": "GET",
- "DIALOG": "DIALOG"
- },
- "default_value": "POST",
- "return_format": "value",
- "allow_null": 0,
- "layout": "horizontal"
- },
- {
- "key": "field_6684017c8bd20",
- "label": "Submission",
- "name": "",
- "aria-label": "",
- "type": "accordion",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "open": 0,
- "multi_expand": 1,
- "endpoint": 0
- },
- {
- "key": "field_66992c02d61ed",
- "label": "Save to Database?",
- "name": "save_data",
- "aria-label": "",
- "type": "true_false",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "message": "",
- "default_value": 1,
- "ui_on_text": "",
- "ui_off_text": "",
- "ui": 1
- },
- {
- "key": "field_66832f771e208",
- "label": "Confirmation",
- "name": "confirmation",
- "aria-label": "",
- "type": "button_group",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "choices": {
- "message": "Message",
- "redirect": "Redirect",
- "content": "Page Content"
- },
- "default_value": "message",
- "return_format": "value",
- "allow_null": 0,
- "layout": "horizontal"
- },
- {
- "key": "field_66832f9c1e209",
- "label": "Message",
- "name": "message",
- "aria-label": "",
- "type": "textarea",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66832f771e208",
- "operator": "==",
- "value": "message"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "default_value": "Thank you for your submission!",
- "maxlength": "",
- "rows": "",
- "placeholder": "",
- "new_lines": ""
- },
- {
- "key": "field_668952d3e1d7f",
- "label": "Page",
- "name": "page",
- "aria-label": "",
- "type": "post_object",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66832f771e208",
- "operator": "==",
- "value": "redirect"
- },
- {
- "field": "field_66895376e1d81",
- "operator": "!=",
- "value": "1"
- }
- ],
- [
- {
- "field": "field_66832f771e208",
- "operator": "==",
- "value": "content"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "post_type": [
- "page"
- ],
- "post_status": "",
- "taxonomy": "",
- "return_format": "object",
- "multiple": 0,
- "allow_null": 0,
- "bidirectional": 0,
- "ui": 1,
- "bidirectional_target": []
- },
- {
- "key": "field_66895376e1d81",
- "label": "Custom URL",
- "name": "custom_url",
- "aria-label": "",
- "type": "true_false",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66832f771e208",
- "operator": "==",
- "value": "redirect"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "message": "",
- "default_value": 0,
- "ui_on_text": "",
- "ui_off_text": "",
- "ui": 1
- },
- {
- "key": "field_66832fbc1e20a",
- "label": "Redirect URL",
- "name": "redirect",
- "aria-label": "",
- "type": "url",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66832f771e208",
- "operator": "==",
- "value": "redirect"
- },
- {
- "field": "field_66895376e1d81",
- "operator": "==",
- "value": "1"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "default_value": "",
- "placeholder": "https:\/\/"
- },
- {
- "key": "field_66895ea1c1062",
- "label": "Notification",
- "name": "",
- "aria-label": "",
- "type": "accordion",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "open": 1,
- "multi_expand": 1,
- "endpoint": 0
- },
- {
- "key": "field_66895ec6c1063",
- "label": "Site Admin Email",
- "name": "admin_email",
- "aria-label": "",
- "type": "true_false",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "message": "",
- "default_value": 1,
- "ui_on_text": "Enabled",
- "ui_off_text": "Disabled",
- "ui": 1
- },
- {
- "key": "field_669eb7e04224d",
- "label": "Admin Template",
- "name": "admin_template",
- "aria-label": "",
- "type": "select",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66895ec6c1063",
- "operator": "==",
- "value": "1"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "choices": [
- "All Fields"
- ],
- "default_value": 0,
- "return_format": "value",
- "multiple": 0,
- "allow_null": 0,
- "ui": 1,
- "ajax": 0,
- "placeholder": ""
- },
- {
- "key": "field_66895efdc1064",
- "label": "Confirmation Email",
- "name": "confirmation_email",
- "aria-label": "",
- "type": "true_false",
- "instructions": "Form must have an Email field.",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "message": "",
- "default_value": 1,
- "ui_on_text": "Enabled",
- "ui_off_text": "Disabled",
- "ui": 1
- },
- {
- "key": "field_669eb8184224e",
- "label": "Confirmation Template",
- "name": "confirmation_template",
- "aria-label": "",
- "type": "select",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66895efdc1064",
- "operator": "==",
- "value": "1"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "choices": [
- "All Fields"
- ],
- "default_value": 0,
- "return_format": "value",
- "multiple": 0,
- "allow_null": 0,
- "ui": 1,
- "ajax": 0,
- "placeholder": ""
- },
- {
- "key": "field_66895f4bc1065",
- "label": "Custom Email",
- "name": "custom_email",
- "aria-label": "",
- "type": "true_false",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "message": "",
- "default_value": 0,
- "ui_on_text": "Enabled",
- "ui_off_text": "Disabled",
- "ui": 1
- },
- {
- "key": "field_66895f71c1066",
- "label": "Email Recipient",
- "name": "email_recipient",
- "aria-label": "",
- "type": "email",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66895f4bc1065",
- "operator": "==",
- "value": "1"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "default_value": "",
- "placeholder": "name@domain.com",
- "prepend": "",
- "append": ""
- },
- {
- "key": "field_669eb8394224f",
- "label": "Custom Template",
- "name": "custom_template",
- "aria-label": "",
- "type": "select",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66895f4bc1065",
- "operator": "==",
- "value": "1"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "choices": [
- "All Fields"
- ],
- "default_value": 0,
- "return_format": "value",
- "multiple": 0,
- "allow_null": 0,
- "ui": 1,
- "ajax": 0,
- "placeholder": ""
- }
- ],
- "location": [
- [
- {
- "param": "block",
- "operator": "==",
- "value": "acf\/form"
- }
- ]
- ],
- "menu_order": 0,
- "position": "normal",
- "style": "default",
- "label_placement": "top",
- "instruction_placement": "label",
- "hide_on_screen": "",
- "active": true,
- "description": "",
- "show_in_rest": 0,
- "modified": 1721743431
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/form/render.php b/wp-content/plugins/viget-form-blocks/blocks/form/render.php
deleted file mode 100644
index f7e14f62..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/form/render.php
+++ /dev/null
@@ -1,34 +0,0 @@
- $form->get_form_object()->get_template(),
-];
-
-$attrs = $form->get_form_object()->get_attrs();
-?>
-get_submission()->is_processed() ) : ?>
- >
- get_confirmation()->render(); ?>
-
-
-
-
-
diff --git a/wp-content/plugins/viget-form-blocks/blocks/form/style.css b/wp-content/plugins/viget-form-blocks/blocks/form/style.css
deleted file mode 100644
index e60b6e1d..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/form/style.css
+++ /dev/null
@@ -1,80 +0,0 @@
-/** Generic Form Styles **/
-.acf-block-form input[type="text"],
-.acf-block-form input[type="email"],
-.acf-block-form input[type="tel"],
-.acf-block-form input[type="url"],
-.acf-block-form input[type="number"],
-.acf-block-form input[type="password"],
-.acf-block-form input[type="date"],
-.acf-block-form input[type="time"],
-.acf-block-form input[type="datetime-local"],
-.acf-block-form select,
-.acf-block-form textarea {
- background-color: #fff;
- border-radius: 3px;
- border: 1px solid #000;
- display: block;
- max-width: 100%;
- padding: 0.5rem 0.75rem;
- width: 100%;
-}
-
-.acf-block-form input[type="file"],
-.acf-block-form input[type="color"] {
- background-color: #fff;
-}
-
-.acf-block-form > .form-input.input-type-hidden,
-.acf-block-form *:not([data-block]) > .form-input.input-type-hidden {
- display: none;
-}
-
-.acf-block-form .form-input > label,
-.acf-block-form .form-fieldset > legend,
-.acf-block-form .acf-block-radios .radios-label {
- display: flex;
- flex-wrap: wrap;
- gap: 0.25rem;
- width: 100%;
-}
-
-.acf-block-form label {
- cursor: pointer;
-}
-.acf-block-form label > *,
-.acf-block-form legend > * {
- display: inline-block;
-}
-.acf-block-form .is-required {
- color: red;
-}
-
-.acf-block-form > .form-input + .form-input,
-.acf-block-form > .form-input + .wp-block-group,
-.acf-block-form > .form-input + .wp-block-columns,
-.acf-block-form > .form-input + .acf-block-fieldset,
-.acf-block-form > .acf-block-fieldset + .form-input,
-.acf-block-form > .wp-block-group + .form-input,
-.acf-block-form footer.form-submit {
- margin-block-start: 1.75em;
-}
-
-.acf-block-form > .wp-block-group > *,
-.acf-block-form > .acf-block-fieldset > * {
- margin-block-start: 0.75rem;
-}
-
-:where(body .is-layout-flow) > *[hidden]:first-child + * {
- margin-block-start: 0;
-}
-
-.acf-block-form .wp-block-columns:last-child {
- margin-bottom: 0;
-}
-
-.viget-form-blocks-validation {
- border: 1px solid red;
- background-color: rgba( 255, 0, 0, 0.1 );
- padding: 1em;
- margin: 1.75em 0;
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/input/block.json b/wp-content/plugins/viget-form-blocks/blocks/input/block.json
deleted file mode 100644
index 9c2b7541..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/input/block.json
+++ /dev/null
@@ -1,149 +0,0 @@
-{
- "name": "input",
- "title": "Input Field",
- "description": "Form input field",
- "icon": "edit",
- "category": "forms",
- "textdomain": "viget-form-blocks",
- "keywords": ["input", "contact", "feedback", "input", "text", "phone", "email", "url", "number", "hidden", "date", "time", "color", "upload", "file"],
- "ancestor": ["acf/form"],
- "supports": {
- "jsx": true,
- "mode": false,
- "alignWide": true,
- "anchor": true
- },
- "providesContext": {
- "acffb/fieldId": "blockId"
- },
- "style": "file:./style.css",
- "attributes": {
- "blockId": {
- "type": "string",
- "default": ""
- }
- },
- "variations": [
- {
- "name": "input-email",
- "icon": "email",
- "title": "Email Address",
- "scope": ["inserter", "transform"],
- "innerBlocks": [ [ "acf/label", {}, [ [ "core/paragraph", { "content": "Email Address" } ] ] ] ],
- "attributes": {
- "data": {
- "type": "email"
- }
- },
- "isActive": ["data"]
- },
- {
- "name": "input-url",
- "icon": "admin-links",
- "title": "Website Field",
- "scope": ["inserter", "transform"],
- "innerBlocks": [ [ "acf/label", {}, [ [ "core/paragraph", { "content": "Website" } ] ] ] ],
- "attributes": {
- "data": {
- "type": "url"
- }
- },
- "isActive": ["data"]
- },
- {
- "name": "input-tel",
- "icon": "smartphone",
- "title": "Phone Number",
- "scope": ["inserter", "transform"],
- "innerBlocks": [ [ "acf/label", {}, [ [ "core/paragraph", { "content": "Phone Number" } ] ] ] ],
- "attributes": {
- "data": {
- "type": "tel"
- }
- },
- "isActive": ["data"]
- },
- {
- "name": "input-number",
- "icon": "calculator",
- "title": "Number Field",
- "scope": ["inserter", "transform"],
- "innerBlocks": [ [ "acf/label", {}, [ [ "core/paragraph", { "content": "Number" } ] ] ] ],
- "attributes": {
- "data": {
- "type": "number"
- }
- },
- "isActive": ["data"]
- },
- {
- "name": "input-file",
- "icon": "cloud-upload",
- "title": "File/Upload Field",
- "scope": ["inserter", "transform"],
- "innerBlocks": [ [ "acf/label", {}, [ [ "core/paragraph", { "content": "Upload File" } ] ] ] ],
- "attributes": {
- "data": {
- "type": "file"
- }
- },
- "isActive": ["data"]
- },
- {
- "name": "input-hidden",
- "icon": "hidden",
- "title": "Hidden Field",
- "scope": ["inserter", "transform"],
- "innerBlocks": [ [ "acf/label", {}, [ [ "core/paragraph", { "content": "Hidden" } ] ] ] ],
- "attributes": {
- "data": {
- "type": "hidden"
- }
- },
- "isActive": ["data"]
- },
- {
- "name": "input-date",
- "icon": "calendar-alt",
- "title": "Date Field",
- "scope": ["inserter", "transform"],
- "innerBlocks": [ [ "acf/label", {}, [ [ "core/paragraph", { "content": "Date" } ] ] ] ],
- "attributes": {
- "data": {
- "type": "date"
- }
- },
- "isActive": ["data"]
- },
- {
- "name": "input-time",
- "icon": "clock",
- "title": "Time Field",
- "scope": ["inserter", "transform"],
- "innerBlocks": [ [ "acf/label", {}, [ [ "core/paragraph", { "content": "Time" } ] ] ] ],
- "attributes": {
- "data": {
- "type": "time"
- }
- },
- "isActive": ["data"]
- },
- {
- "name": "input-color",
- "icon": "color-picker",
- "title": "Color Picker",
- "scope": ["inserter", "transform"],
- "innerBlocks": [ [ "acf/label", {}, [ [ "core/paragraph", { "content": "Pick a Color" } ] ] ] ],
- "attributes": {
- "data": {
- "type": "color"
- }
- },
- "isActive": ["data"]
- }
- ],
- "usesContext": ["acffb/formId", "acffb/fieldsetId"],
- "acf": {
- "mode": "preview"
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/input/group_66832bf2f293a.json b/wp-content/plugins/viget-form-blocks/blocks/input/group_66832bf2f293a.json
deleted file mode 100644
index ca892251..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/input/group_66832bf2f293a.json
+++ /dev/null
@@ -1,228 +0,0 @@
-{
- "key": "group_66832bf2f293a",
- "title": "Block: Input",
- "fields": [
- {
- "key": "field_66832bf3c10aa",
- "label": "Input Type",
- "name": "type",
- "aria-label": "",
- "type": "select",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "choices": {
- "text": "Text",
- "email": "Email",
- "url": "URL",
- "tel": "Phone",
- "number": "Number",
- "password": "Password",
- "file": "File\/Upload",
- "datetime-local": "Date\/Time",
- "date": "Date",
- "time": "Time",
- "color": "Color Picker",
- "hidden": "Hidden"
- },
- "default_value": "text",
- "return_format": "value",
- "multiple": 0,
- "allow_null": 0,
- "ui": 0,
- "ajax": 0,
- "placeholder": ""
- },
- {
- "key": "field_669718dcc6615",
- "label": "Default Value",
- "name": "default_value",
- "aria-label": "",
- "type": "text",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "default_value": "",
- "maxlength": "",
- "placeholder": "",
- "prepend": "",
- "append": ""
- },
- {
- "key": "field_66886c0865624",
- "label": "Max Length",
- "name": "maxlength",
- "aria-label": "",
- "type": "number",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "default_value": "",
- "min": "",
- "max": "",
- "placeholder": "",
- "step": "",
- "prepend": "",
- "append": ""
- },
- {
- "key": "field_66848acde5856",
- "label": "Controls",
- "name": "controls",
- "aria-label": "",
- "type": "true_false",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66832bf3c10aa",
- "operator": "==",
- "value": "number"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "message": "",
- "default_value": 1,
- "ui_on_text": "Enabled",
- "ui_off_text": "Disabled",
- "ui": 1
- },
- {
- "key": "field_668865b10c6a5",
- "label": "Controls Settings",
- "name": "controls_settings",
- "aria-label": "",
- "type": "group",
- "instructions": "",
- "required": 0,
- "conditional_logic": [
- [
- {
- "field": "field_66832bf3c10aa",
- "operator": "==",
- "value": "number"
- },
- {
- "field": "field_66848acde5856",
- "operator": "==",
- "value": "1"
- }
- ]
- ],
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "layout": "block",
- "sub_fields": [
- {
- "key": "field_668865d10c6a7",
- "label": "Min",
- "name": "min",
- "aria-label": "",
- "type": "number",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "33.33",
- "class": "",
- "id": ""
- },
- "default_value": "",
- "min": "",
- "max": "",
- "placeholder": "",
- "step": "",
- "prepend": "",
- "append": ""
- },
- {
- "key": "field_668865ef0c6a8",
- "label": "Max",
- "name": "max",
- "aria-label": "",
- "type": "number",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "33.33",
- "class": "",
- "id": ""
- },
- "default_value": "",
- "min": "",
- "max": "",
- "placeholder": "",
- "step": "",
- "prepend": "",
- "append": ""
- },
- {
- "key": "field_6688660c0c6a9",
- "label": "Step",
- "name": "step",
- "aria-label": "",
- "type": "number",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "33.33",
- "class": "",
- "id": ""
- },
- "default_value": 1,
- "min": "",
- "max": "",
- "placeholder": "",
- "step": "",
- "prepend": "",
- "append": ""
- }
- ]
- }
- ],
- "location": [
- [
- {
- "param": "block",
- "operator": "==",
- "value": "acf\/input"
- }
- ]
- ],
- "menu_order": 10,
- "position": "normal",
- "style": "default",
- "label_placement": "top",
- "instruction_placement": "label",
- "hide_on_screen": "",
- "active": true,
- "description": "",
- "show_in_rest": 0,
- "modified": 1721178350
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/input/render.php b/wp-content/plugins/viget-form-blocks/blocks/input/render.php
deleted file mode 100644
index a4124833..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/input/render.php
+++ /dev/null
@@ -1,31 +0,0 @@
- $field->get_template()
-];
-?>
-
diff --git a/wp-content/plugins/viget-form-blocks/blocks/input/style.css b/wp-content/plugins/viget-form-blocks/blocks/input/style.css
deleted file mode 100644
index e8f83212..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/input/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-input[type=number][data-appearance=none]::-webkit-outer-spin-button,
-input[type=number][data-appearance=none]::-webkit-inner-spin-button {
- -webkit-appearance: none;
- margin: 0;
-}
-
-/* Firefox */
-input[type=number][data-appearance=none] {
- -moz-appearance:textfield;
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/label/block.json b/wp-content/plugins/viget-form-blocks/blocks/label/block.json
deleted file mode 100644
index 5f8a843f..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/label/block.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "label",
- "title": "Label",
- "description": "Form field label",
- "icon": "tag",
- "category": "forms",
- "textdomain": "viget-form-blocks",
- "keywords": ["input", "description", "text", "name", "field"],
- "ancestor": ["acf/form"],
- "parent": ["acf/input", "acf/select", "acf/textarea", "acf/radios", "acf/checkbox"],
- "supports": {
- "jsx": true,
- "mode": false,
- "alignWide": false,
- "anchor": true
- },
- "attributes": {
- "blockId": {
- "type": "string",
- "default": ""
- }
- },
- "style": "file:./style.css",
- "usesContext": ["acffb/formId", "acffb/fieldId"],
- "acf": {
- "mode": "preview"
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/label/render.php b/wp-content/plugins/viget-form-blocks/blocks/label/render.php
deleted file mode 100644
index a42fd3b0..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/label/render.php
+++ /dev/null
@@ -1,37 +0,0 @@
-get_parent_field();
-$required = $parent?->is_required() ?? false;
-$placement = $parent?->get_marker_placement() ?? 'before';
-
-$inner = [
- 'template' => $field->get_template(),
- 'allowedBlocks' => [ 'core/paragraph' ],
-];
-?>
-
diff --git a/wp-content/plugins/viget-form-blocks/blocks/label/style.css b/wp-content/plugins/viget-form-blocks/blocks/label/style.css
deleted file mode 100644
index da4de591..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/label/style.css
+++ /dev/null
@@ -1,13 +0,0 @@
-.acf-block-label p:not(:empty):not(:last-child) {
- margin-top: 0;
-}
-
-.acf-block-label > *:not(.acf-innerblocks-container),
-.acf-block-label > .acf-innerblocks-container > * {
- display: inline-block;
-}
-
-.acf-block-label > *:not(.acf-innerblocks-container):not(:first-child),
-.acf-block-label > .acf-innerblocks-container > *:not(:first-child) {
- margin-left: 0.25rem;
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/legend/block.json b/wp-content/plugins/viget-form-blocks/blocks/legend/block.json
deleted file mode 100644
index eb69353b..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/legend/block.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "legend",
- "title": "Legend",
- "description": "Form fieldset legend",
- "icon": "edit",
- "category": "forms",
- "textdomain": "viget-form-blocks",
- "keywords": ["input", "contact", "feedback", "group", "set"],
- "ancestor": ["acf/form"],
- "parent": ["acf/fieldset"],
- "supports": {
- "jsx": true,
- "mode": false,
- "alignWide": false,
- "anchor": true
- },
- "attributes": {
- "blockId": {
- "type": "string",
- "default": ""
- }
- },
- "usesContext": ["acffb/formId", "acffb/fieldsetId"],
- "acf": {
- "mode": "preview"
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/legend/render.php b/wp-content/plugins/viget-form-blocks/blocks/legend/render.php
deleted file mode 100644
index 7b0f86ec..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/legend/render.php
+++ /dev/null
@@ -1,37 +0,0 @@
-get_fieldset();
-$required = $fieldset?->is_required() ?? false;
-$placement = $fieldset?->get_marker_placement() ?? 'after';
-
-$inner = [
- 'template' => $field->get_template(),
- 'allowedBlocks' => [ 'core/paragraph' ],
-];
-?>
-
diff --git a/wp-content/plugins/viget-form-blocks/blocks/radios/block.json b/wp-content/plugins/viget-form-blocks/blocks/radios/block.json
deleted file mode 100644
index 3e5511ec..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/radios/block.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "radios",
- "title": "Radios",
- "description": "Form radio button field",
- "icon": "edit",
- "category": "forms",
- "textdomain": "viget-form-blocks",
- "keywords": ["input", "contact", "feedback", "input", "choose", "option", "options"],
- "ancestor": ["acf/form"],
- "styles": [
- { "name": "default", "label": "Default", "isDefault": true },
- { "name": "inline", "label": "Inline" }
- ],
- "style": "file:./style.css",
- "supports": {
- "jsx": true,
- "alignWide": true,
- "anchor": true
- },
- "attributes": {
- "blockId": {
- "type": "string",
- "default": ""
- }
- },
- "providesContext": {
- "acffb/fieldId": "blockId"
- },
- "usesContext": ["acffb/formId", "acffb/fieldsetId"],
- "acf": {
- "mode": "preview"
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/radios/render.php b/wp-content/plugins/viget-form-blocks/blocks/radios/render.php
deleted file mode 100644
index 7472b523..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/radios/render.php
+++ /dev/null
@@ -1,54 +0,0 @@
-get_options();
-$inner = [
- 'template' => $field->get_template(),
-];
-
-$has_checked = false;
-?>
-get_attrs() ); ?>>
-
-
-
-
-
-
-
-
diff --git a/wp-content/plugins/viget-form-blocks/blocks/radios/style.css b/wp-content/plugins/viget-form-blocks/blocks/radios/style.css
deleted file mode 100644
index 83ee3e03..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/radios/style.css
+++ /dev/null
@@ -1,27 +0,0 @@
-.acf-block-radios ul.radios-options,
-.acf-block-radios ul.radios-options li {
- list-style: none;
-}
-
-.acf-block-radios ul.radios-options {
- padding-top: 0.75rem;
-}
-
-.acf-block-radios ul.radios-options li {
- align-items: center;
- display: flex;
- flex-wrap: wrap;
- gap: 0.5rem;
- justify-content: center;
-}
-
-.acf-block-radios ul.radios-options input[type=radio] {
- cursor: pointer;
- min-height: 1.25rem;
- min-width: 1.25rem;
-}
-
-.acf-block-radios.is-style-inline ul.radios-options {
- display: flex;
- gap: 1rem;
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/select/block.json b/wp-content/plugins/viget-form-blocks/blocks/select/block.json
deleted file mode 100644
index b21b8714..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/select/block.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "select",
- "title": "Select",
- "description": "Form select field",
- "icon": "edit",
- "category": "forms",
- "textdomain": "viget-form-blocks",
- "keywords": ["input", "contact", "feedback", "input", "dropdown", "option"],
- "ancestor": ["acf/form"],
- "supports": {
- "jsx": true,
- "alignWide": true,
- "anchor": true
- },
- "editorStyle": "file:./editor.css",
- "attributes": {
- "blockId": {
- "type": "string",
- "default": ""
- }
- },
- "usesContext": ["acffb/formId", "acffb/fieldsetId"],
- "providesContext": {
- "acffb/fieldId": "blockId"
- },
- "acf": {
- "mode": "preview"
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/select/editor.css b/wp-content/plugins/viget-form-blocks/blocks/select/editor.css
deleted file mode 100644
index 21b2a059..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/select/editor.css
+++ /dev/null
@@ -1,52 +0,0 @@
-div[data-type="acf/select"] .acf-field-repeater[data-name="options"] .acf-fields {
- display: flex;
- flex-wrap: wrap;
-}
-
-div[data-type="acf/select"] .acf-field-repeater[data-name="options"] .acf-field-true-false {
- width: 90px;
- text-align: center;
- order: 2;
-}
-
-div[data-type="acf/select"] .acf-field-repeater[data-name="options"] .acf-field-text[data-name="label"] {
- width: calc(100% - 180px);
- order: 1;
-}
-div[data-type="acf/select"] .acf-field-repeater[data-name="options"] .acf-field-text[data-name="value"] {
- width: 100%;
- order: 3;
-}
-
-div[data-type="acf/select"] .acf-field-repeater[data-name="options"] .acf-field-true-false,
-.acf-block-panel .acf-field-repeater[data-name="options"] .acf-fields .acf-field-true-false {
- background-color: #f4f4f4;
-}
-
-.acf-block-panel .acf-field-repeater[data-name="options"] .acf-fields .acf-field-true-false {
- border-bottom: 1px solid #e2e4e7;
- clear: none;
- cursor: pointer;
- display: flex;
- float: left !important;
- gap: 0.25rem;
- justify-content: center;
- padding-bottom: 0;
- padding-left: 0;
- padding-right: 0;
- text-align: center;
- width: 50% !important;
-}
-.acf-block-panel .acf-field-repeater[data-name="options"] .acf-fields .acf-field-true-false:first-child {
- border-right: 1px solid #e2e4e7;
- width: calc( 50% - 1px ) !important;
-}
-
-div[data-type="acf/select"] .acf-field-repeater[data-name="options"] .acf-field-true-false {
- border-left: 1px solid #e2e4e7;
-}
-
-
-.acf-block-panel .acf-field-repeater[data-name="options"] .acf-fields .acf-field-true-false .acf-label {
- order: 2;
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/select/group_66970a1373563.json b/wp-content/plugins/viget-form-blocks/blocks/select/group_66970a1373563.json
deleted file mode 100644
index 435a8c27..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/select/group_66970a1373563.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "key": "group_66970a1373563",
- "title": "Block: Select",
- "fields": [
- {
- "key": "field_66970a1340d39",
- "label": "Allow Multiple",
- "name": "allow_multiple",
- "aria-label": "",
- "type": "true_false",
- "instructions": "",
- "required": 0,
- "conditional_logic": 0,
- "wrapper": {
- "width": "",
- "class": "",
- "id": ""
- },
- "message": "",
- "default_value": 0,
- "ui_on_text": "",
- "ui_off_text": "",
- "ui": 1
- }
- ],
- "location": [
- [
- {
- "param": "block",
- "operator": "==",
- "value": "acf\/select"
- }
- ]
- ],
- "menu_order": 0,
- "position": "normal",
- "style": "default",
- "label_placement": "top",
- "instruction_placement": "label",
- "hide_on_screen": "",
- "active": true,
- "description": "",
- "show_in_rest": 0,
- "modified": 1721174581
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/select/render.php b/wp-content/plugins/viget-form-blocks/blocks/select/render.php
deleted file mode 100644
index 13ff68a2..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/select/render.php
+++ /dev/null
@@ -1,45 +0,0 @@
-get_options();
-$inner = [
- 'template' => $field->get_template(),
-];
-
-$has_selected = false;
-?>
-
-
-
-
-
-
diff --git a/wp-content/plugins/viget-form-blocks/blocks/submit/block.json b/wp-content/plugins/viget-form-blocks/blocks/submit/block.json
deleted file mode 100644
index a57b269f..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/submit/block.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "submit",
- "title": "Submit",
- "description": "Form submit field",
- "icon": "button",
- "category": "forms",
- "textdomain": "viget-form-blocks",
- "keywords": ["input", "contact", "feedback", "input", "button"],
- "ancestor": ["acf/form"],
- "supports": {
- "jsx": true,
- "mode": false,
- "alignWide": false,
- "anchor": true
- },
- "attributes": {
- "blockId": {
- "type": "string",
- "default": ""
- }
- },
- "usesContext": ["acffb/formId", "acffb/fieldsetId"],
- "acf": {
- "mode": "preview"
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/submit/block.php b/wp-content/plugins/viget-form-blocks/blocks/submit/block.php
deleted file mode 100644
index 38753f87..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/submit/block.php
+++ /dev/null
@@ -1,11 +0,0 @@
- [ 'move' => false, 'remove' => true ] ] ) )
- ->add( ( new Block( 'core/button', [
- 'text' => __( 'Submit', 'viget-form-blocks' ),
- 'lock' => [ 'move' => false, 'remove' => true ],
- ] ) ) );
-
-$inner = [
- 'template' => ( new Template( $buttons ) )->get(),
-];
-
-// TODO: Set up form footer as separate component.
-?>
-
diff --git a/wp-content/plugins/viget-form-blocks/blocks/textarea/block.json b/wp-content/plugins/viget-form-blocks/blocks/textarea/block.json
deleted file mode 100644
index 76b205f3..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/textarea/block.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "textarea",
- "title": "Textarea",
- "description": "Form textarea field",
- "icon": "edit",
- "category": "forms",
- "textdomain": "viget-form-blocks",
- "keywords": ["input", "contact", "feedback", "input"],
- "ancestor": ["acf/form"],
- "supports": {
- "jsx": true,
- "mode": false,
- "alignWide": true,
- "anchor": true,
- "dimensions": {
- "minHeight": true
- }
- },
- "attributes": {
- "blockId": {
- "type": "string",
- "default": ""
- }
- },
- "usesContext": ["acffb/formId", "acffb/fieldsetId"],
- "providesContext": {
- "acffb/fieldId": "blockId"
- },
- "acf": {
- "mode": "preview"
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/blocks/textarea/render.php b/wp-content/plugins/viget-form-blocks/blocks/textarea/render.php
deleted file mode 100644
index f29262ae..00000000
--- a/wp-content/plugins/viget-form-blocks/blocks/textarea/render.php
+++ /dev/null
@@ -1,26 +0,0 @@
- $field->get_template(),
-];
-?>
-
-
-
-
-
diff --git a/wp-content/plugins/viget-form-blocks/classes/Admin/EmailTemplate.php b/wp-content/plugins/viget-form-blocks/classes/Admin/EmailTemplate.php
deleted file mode 100644
index 1d3178d9..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Admin/EmailTemplate.php
+++ /dev/null
@@ -1,498 +0,0 @@
-register_post_type();
-
- // Register the Meta Fields
- $this->register_fields();
-
- // Populate the Forms meta select field.
- $this->populate_forms_select();
-
- // Populate the Form Fields meta select field.
- $this->populate_fields_select();
-
- // Populate the meta fields select field.
- $this->populate_meta_select();
-
- // Filter the Template selects by form ID.
- $this->filter_template_selects();
-
- // Show the form name admin column.
- $this->form_admin_column();
-
- // Customize admin columns
- $this->admin_columns();
-
- // Add Filter by Form ID.
- $this->admin_filters();
-
- // Prevent Deletion of the default template.
- $this->protect_default_template();
- }
-
- /**
- * Register the Email Template post type.
- *
- * @return void
- */
- private function register_post_type(): void {
- add_action(
- 'init',
- function() {
- $labels = [
- 'name' => _x( 'Email Templates', 'Post Type General Name', 'viget-form-blocks' ),
- 'singular_name' => _x( 'Email Template', 'Post Type Singular Name', 'viget-form-blocks' ),
- 'menu_name' => __( 'Email Templates', 'viget-form-blocks' ),
- 'name_admin_bar' => __( 'Email Template', 'viget-form-blocks' ),
- 'archives' => __( '', 'viget-form-blocks' ),
- 'attributes' => __( 'Email Template Attributes', 'viget-form-blocks' ),
- 'parent_item_colon' => __( 'Parent Email Template:', 'viget-form-blocks' ),
- 'all_items' => __( 'All Email Templates', 'viget-form-blocks' ),
- 'add_new_item' => __( 'Add New Email Template', 'viget-form-blocks' ),
- 'add_new' => __( 'Add New', 'viget-form-blocks' ),
- 'new_item' => __( 'New Email Template', 'viget-form-blocks' ),
- 'edit_item' => __( 'Edit Email Template', 'viget-form-blocks' ),
- 'update_item' => __( 'Update Email Template', 'viget-form-blocks' ),
- 'view_item' => __( 'View Email Template', 'viget-form-blocks' ),
- 'view_items' => __( 'View Email Templates', 'viget-form-blocks' ),
- 'search_items' => __( 'Search Email Template', 'viget-form-blocks' ),
- 'not_found' => __( 'Not found', 'viget-form-blocks' ),
- 'not_found_in_trash' => __( 'Not found in Trash', 'viget-form-blocks' ),
- 'featured_image' => __( 'Featured Image', 'viget-form-blocks' ),
- 'set_featured_image' => __( 'Set featured image', 'viget-form-blocks' ),
- 'remove_featured_image' => __( 'Remove featured image', 'viget-form-blocks' ),
- 'use_featured_image' => __( 'Use as featured image', 'viget-form-blocks' ),
- 'insert_into_item' => __( 'Insert into email template', 'viget-form-blocks' ),
- 'uploaded_to_this_item' => __( 'Uploaded to this email template', 'viget-form-blocks' ),
- 'items_list' => __( 'Email Templates list', 'viget-form-blocks' ),
- 'items_list_navigation' => __( 'Email Templates list navigation', 'viget-form-blocks' ),
- 'filter_items_list' => __( 'Filter email templates list', 'viget-form-blocks' ),
- ];
- $args = [
- 'label' => __( 'Email Template', 'viget-form-blocks' ),
- 'description' => __( 'Form Block Email Templates', 'viget-form-blocks' ),
- 'labels' => $labels,
- 'supports' => [ 'title', 'editor', 'thumbnail', 'revisions' ],
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => 'acffb-forms',
- 'menu_position' => 20,
- 'menu_icon' => 'dashicons-feedback',
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => false,
- 'can_export' => true,
- 'has_archive' => false,
- 'exclude_from_search' => true,
- 'publicly_queryable' => true,
- 'rewrite' => false,
- 'capability_type' => 'page',
- 'show_in_rest' => true,
- 'template' => [
- [ 'acf/all-fields' ]
- ],
- ];
-
- register_post_type( self::POST_TYPE, $args );
- }
- );
- }
-
- /**
- * Register the fields for the Email Template post type.
- *
- * @return void
- */
- private function register_fields(): void {
- add_action( 'acf/include_fields', function() {
- if ( ! function_exists( 'acf_add_local_field_group' ) ) {
- return;
- }
-
- acf_add_local_field_group( array(
- 'key' => 'group_669aadf85e88f',
- 'title' => 'Template Settings',
- 'fields' => array(
- array(
- 'key' => 'field_669aadf8d2686',
- 'label' => 'Form',
- 'name' => '_vgtfb_form_id',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- '0' => 'Any Form',
- ),
- 'default_value' => '0',
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 1,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- array(
- 'key' => 'field_669ec6e670126',
- 'label' => 'Email Subject',
- 'name' => 'email_subject',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'maxlength' => '',
- 'placeholder' => 'New Form Submission',
- 'prepend' => '',
- 'append' => '',
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'post_type',
- 'operator' => '==',
- 'value' => 'acffb-email-template',
- ),
- ),
- ),
- 'menu_order' => 0,
- 'position' => 'side',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 1,
- ) );
- } );
-
- }
-
- /**
- * Register custom admin columns for Email Templates
- *
- * @return void
- */
- private function admin_columns(): void {
- add_filter(
- 'manage_' . self::POST_TYPE . '_posts_columns',
- function( array $columns ): array {
- $new_columns = [];
- foreach ( $columns as $key => $column ) {
- $new_columns[ $key ] = $column;
- if ( 'title' === $key ) {
- $new_columns['_vgtfb_form_id'] = __( 'Form', 'viget-form-blocks' );
- }
- }
-
- return $new_columns;
- }
- );
- }
-
- /**
- * Populate the Form Field select with available fields.
- *
- * @return void
- */
- private function populate_fields_select(): void {
- add_filter(
- 'acf/prepare_field/key=field_669ea8d7298be',
- function ( array $field ): array {
- $form = Form::get_instance();
-
- if ( ! $form ) {
- $field['choices'] = [
- '' => __( 'Select a form and update to see fields.', 'viget-form-blocks' ),
- ];
- return $field;
- }
-
- foreach ( $form->get_form_object()->get_all_fields() as $form_field ) {
- $field['choices'][ $form_field->get_id() ] = $form_field->get_label();
- }
-
- return $field;
- }
- );
- }
-
- /**
- * Populate the Meta select with available meta.
- *
- * @return void
- */
- private function populate_meta_select(): void {
- add_filter(
- 'acf/prepare_field/key=field_66a7b91132f2d',
- function ( array $field ): array {
- $form = Form::get_instance();
-
- if ( ! $form ) {
- return $field;
- }
-
- foreach ( $form->get_meta() as $meta_field ) {
- $field['choices'][ $meta_field->get_key() ] = $meta_field->get_label();
- }
-
- return $field;
- }
- );
- }
-
- /**
- * Filter specific forms for template dropdowns.
- *
- * @return void
- */
- private function filter_template_selects(): void {
- $filter = function ( array $field ): array {
-
- $block = vgtfb_get_posted_acf_block();
- $form_id = vgtfb_get_block_id_from_acf_block_data( $block );
-
- if ( ! $form_id ) {
- return $field;
- }
-
- $field['choices'] = [];
-
- foreach ( $this->get_templates() as $template_id ) {
- $template_form_id = get_post_meta( $template_id, '_vgtfb_form_id', true );
- if ( $form_id && $template_form_id && $template_form_id !== $form_id ) {
- continue;
- }
-
- $field['choices'][ $template_id ] = get_the_title( $template_id );
- if ( $template_id === self::get_default_template() ) {
- $field['choices'][ $template_id ] .= ' (' . __( 'Default', 'viget-form-blocks' ) . ')';
- }
- }
-
- return $field;
- };
-
- // Admin Template
- add_filter( 'acf/prepare_field/key=field_669eb7e04224d', $filter );
-
- // Confirmation Template
- add_filter( 'acf/prepare_field/key=field_669eb8184224e', $filter );
-
- // Custom Template
- add_filter( 'acf/prepare_field/key=field_669eb8394224f', $filter );
- }
-
- /**
- * Get Email Templates
- *
- * @return array
- */
- public function get_templates(): array {
- if ( ! empty( $this->templates ) ) {
- return $this->templates;
- }
-
- $default_template = self::get_default_template();
-
- $args = [
- 'post_type' => self::POST_TYPE,
- 'posts_per_page' => -1,
- 'post_status' => 'publish',
- 'order' => 'ASC',
- 'orderby' => 'title',
- ];
-
- $templates = get_posts( $args );
-
- if ( ! $templates ) {
- return [];
- }
-
- $templates = wp_list_pluck( $templates, 'ID' );
-
- // Move the default template ID to the top of the array
- if ( $default_template ) {
- $default_template_index = array_search( $default_template, $templates );
- if ( $default_template_index !== false ) {
- unset( $templates[ $default_template_index ] );
- array_unshift( $templates, $default_template );
- }
- }
-
- $this->templates = $templates;
-
- return $this->templates;
- }
-
- /**
- * Get the default template.
- *
- * @return ?int
- */
- public static function get_default_template(): ?int {
- if ( self::$default_template ) {
- return self::$default_template;
- }
-
- $default_template = get_option( self::OPTION_DEFAULT_TEMPLATE_ID );
-
- if ( ! $default_template ) {
- $default_template = self::init_default_template();
- }
-
- if ( $default_template ) {
- self::$default_template = $default_template;
- }
-
- return self::$default_template;
- }
-
- /**
- * Initialize the default template.
- *
- * @return ?int
- */
- private static function init_default_template(): ?int {
- $default_template = wp_insert_post( [
- 'post_title' => __( 'All Fields', 'viget-form-blocks' ),
- 'post_content' => '',
- 'post_status' => 'publish',
- 'post_type' => self::POST_TYPE,
- ] );
-
- if ( ! $default_template ) {
- return null;
- }
-
- update_option( self::OPTION_DEFAULT_TEMPLATE_ID, $default_template );
-
- return $default_template;
- }
-
- /**
- * Prevent deletion of the default template
- *
- * @return void
- */
- private function protect_default_template(): void {
- add_action(
- 'before_delete_post',
- function( int $post_id ) {
- if ( self::get_default_template() === $post_id ) {
- wp_die( __( 'You cannot delete the default template.', 'viget-form-blocks' ) );
- }
- }
- );
-
- add_filter(
- 'acf/pre_save_post',
- function( array $post_data ): array {
- if ( self::get_default_template() === $post_data['ID'] ) {
- unset( $post_data['post_status'] );
- }
-
- return $post_data;
- }
- );
-
- add_filter(
- 'post_row_actions',
- function( array $actions, \WP_Post $post ): array {
- if ( self::get_default_template() === $post->ID ) {
- unset( $actions['trash'] );
- }
-
- return $actions;
- },
- 10,
- 2
- );
-
- add_filter(
- 'display_post_states',
- function( array $post_states, \WP_Post $post ): array {
- if ( self::get_default_template() === $post->ID ) {
- $post_states['default_template'] = __( 'Default', 'viget-form-blocks' );
- }
-
- return $post_states;
- },
- 10,
- 2
- );
-
- add_action(
- 'admin_head',
- function () {
- global $post;
-
- if ( ! $post || self::get_default_template() !== $post->ID ) {
- return;
- }
-
- // Not sure how stable this is. The alternative is using :last-child, but no guarantee Trash is the last item.
- echo '';
- }
- );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Admin/Integration.php b/wp-content/plugins/viget-form-blocks/classes/Admin/Integration.php
deleted file mode 100644
index 9d0275ca..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Admin/Integration.php
+++ /dev/null
@@ -1,723 +0,0 @@
-register_post_type();
-
- // Register custom fields.
- $this->register_fields();
-
- // Populate the forms select.
- $this->populate_forms_select();
-
- // Populate the Form Fields meta select field.
- $this->populate_fields_select();
-
- // Show the form name admin column.
- $this->form_admin_column();
-
- // Customize admin columns
- $this->admin_columns();
-
- // Add Filter by Form ID.
- $this->admin_filters();
-
- // Register the meta boxes.
- $this->meta_boxes();
-
- // Watch for the integration.
- $this->handle_integration_test();
-
- // Temp Fix the post name. TODO: Debug why post slug is being set to the form name.
- add_filter(
- 'wp_insert_post_data',
- function ( array $data ): array {
- if ( self::POST_TYPE !== $data['post_type'] ) {
- return $data;
- }
-
- $data['post_name'] = sanitize_title( $data['post_title'] );
-
- return $data;
- },
- 99
- );
- }
-
- /**
- * Register the Integration post type.
- *
- * @return void
- */
- private function register_post_type(): void {
- add_action(
- 'init',
- function() {
- $labels = [
- 'name' => _x( 'Integrations', 'Post Type General Name', 'viget-form-blocks' ),
- 'singular_name' => _x( 'Integration', 'Post Type Singular Name', 'viget-form-blocks' ),
- 'menu_name' => __( 'Integrations', 'viget-form-blocks' ),
- 'name_admin_bar' => __( 'Integration', 'viget-form-blocks' ),
- 'archives' => '',
- 'attributes' => __( 'Integration Attributes', 'viget-form-blocks' ),
- 'parent_item_colon' => __( 'Parent Integration:', 'viget-form-blocks' ),
- 'all_items' => __( 'All Integrations', 'viget-form-blocks' ),
- 'add_new_item' => __( 'Add New Integration', 'viget-form-blocks' ),
- 'add_new' => __( 'Add New', 'viget-form-blocks' ),
- 'new_item' => __( 'New Integration', 'viget-form-blocks' ),
- 'edit_item' => __( 'Edit Integration', 'viget-form-blocks' ),
- 'update_item' => __( 'Update Integration', 'viget-form-blocks' ),
- 'view_item' => __( 'View Integration', 'viget-form-blocks' ),
- 'view_items' => __( 'View Integrations', 'viget-form-blocks' ),
- 'search_items' => __( 'Search Integration', 'viget-form-blocks' ),
- 'not_found' => __( 'No Integrations found', 'viget-form-blocks' ),
- 'not_found_in_trash' => __( 'Not found in Trash', 'viget-form-blocks' ),
- 'featured_image' => __( 'Featured Image', 'viget-form-blocks' ),
- 'set_featured_image' => __( 'Set featured image', 'viget-form-blocks' ),
- 'remove_featured_image' => __( 'Remove featured image', 'viget-form-blocks' ),
- 'use_featured_image' => __( 'Use as featured image', 'viget-form-blocks' ),
- 'insert_into_item' => __( 'Insert into integration', 'viget-form-blocks' ),
- 'uploaded_to_this_item' => __( 'Uploaded to this integration', 'viget-form-blocks' ),
- 'items_list' => __( 'Integrations list', 'viget-form-blocks' ),
- 'items_list_navigation' => __( 'Integrations list navigation', 'viget-form-blocks' ),
- 'filter_items_list' => __( 'Filter integrations list', 'viget-form-blocks' ),
- ];
- $args = [
- 'label' => __( 'Integration', 'viget-form-blocks' ),
- 'description' => __( 'Form Block Integrations', 'viget-form-blocks' ),
- 'labels' => $labels,
- 'supports' => [ 'title' ],
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => 'acffb-forms',
- 'menu_position' => 10,
- 'menu_icon' => 'dashicons-rest-api',
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => false,
- 'can_export' => true,
- 'has_archive' => false,
- 'exclude_from_search' => true,
- 'publicly_queryable' => true,
- 'rewrite' => false,
- 'capability_type' => 'page',
- ];
-
- register_post_type( self::POST_TYPE, $args );
- }
- );
- }
-
- /**
- * Register the fields for the Email Template post type.
- *
- * @return void
- */
- private function register_fields(): void {
- add_action( 'acf/include_fields', function() {
- if ( ! function_exists( 'acf_add_local_field_group' ) ) {
- return;
- }
-
- acf_add_local_field_group( array(
- 'key' => 'group_6776d358e0939',
- 'title' => 'Integration Configuration',
- 'fields' => array(
- array(
- 'key' => 'field_6776d358e5c47',
- 'label' => 'Form',
- 'name' => '_vgtfb_form_id',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 1,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '50',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 0 => 'Select a Form',
- ),
- 'default_value' => 0,
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'allow_in_bindings' => 1,
- 'ui' => 1,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- array(
- 'key' => 'field_677ad41d06a48',
- 'label' => 'Type',
- 'name' => 'type',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '50',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 'request' => 'Default',
- ),
- 'default_value' => 'request',
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'allow_in_bindings' => 1,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- array(
- 'key' => 'field_6776f6421ad24',
- 'label' => 'Request Details',
- 'name' => 'request',
- 'aria-label' => '',
- 'type' => 'group',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'layout' => 'block',
- 'sub_fields' => array(
- array(
- 'key' => 'field_6776f6611ad25',
- 'label' => 'Request URL',
- 'name' => 'url',
- 'aria-label' => '',
- 'type' => 'url',
- 'instructions' => '',
- 'required' => 1,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'allow_in_bindings' => 0,
- 'placeholder' => 'https://',
- ),
- array(
- 'key' => 'field_6776f67a1ad26',
- 'label' => 'Request Method',
- 'name' => 'method',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 1,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '50',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 'GET' => 'GET',
- 'POST' => 'POST',
- 'PUT' => 'PUT',
- 'PATCH' => 'PATCH',
- 'DELETE' => 'DELETE',
- ),
- 'default_value' => 'POST',
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'allow_in_bindings' => 0,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- array(
- 'key' => 'field_6776f6aa1ad27',
- 'label' => 'Request Format',
- 'name' => 'format',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 1,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '50',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 'JSON' => 'JSON',
- 'Raw' => 'Raw',
- ),
- 'default_value' => 'JSON',
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'allow_in_bindings' => 0,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- ),
- ),
- array(
- 'key' => 'field_6776f7bf1ad28',
- 'label' => 'Request Headers',
- 'name' => 'headers',
- 'aria-label' => '',
- 'type' => 'repeater',
- 'instructions' => 'Optional',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'layout' => 'block',
- 'pagination' => 0,
- 'min' => 0,
- 'max' => 0,
- 'collapsed' => '',
- 'button_label' => 'Add Header',
- 'rows_per_page' => 20,
- 'sub_fields' => array(
- array(
- 'key' => 'field_6776f7d41ad29',
- 'label' => 'Header Name',
- 'name' => 'name',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '50',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'maxlength' => '',
- 'allow_in_bindings' => 0,
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'parent_repeater' => 'field_6776f7bf1ad28',
- ),
- array(
- 'key' => 'field_6776f7f21ad2a',
- 'label' => 'Header Value',
- 'name' => 'value',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '50',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'maxlength' => '',
- 'allow_in_bindings' => 0,
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'parent_repeater' => 'field_6776f7bf1ad28',
- ),
- ),
- ),
- array(
- 'key' => 'field_6776f8361ad2b',
- 'label' => 'Field Mapping',
- 'name' => 'mapping',
- 'aria-label' => '',
- 'type' => 'repeater',
- 'instructions' => 'Leave empty to send all field data.',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_6776d358e5c47',
- 'operator' => '!=',
- 'value' => '0',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'layout' => 'block',
- 'pagination' => 0,
- 'min' => 0,
- 'max' => 0,
- 'collapsed' => '',
- 'button_label' => 'Add Field',
- 'rows_per_page' => 20,
- 'sub_fields' => array(
- array(
- 'key' => 'field_6776f8701ad2c',
- 'label' => 'Form Field',
- 'name' => 'field',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '50',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 0 => 'Select a Field',
- ),
- 'default_value' => 0,
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'allow_in_bindings' => 0,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- 'parent_repeater' => 'field_6776f8361ad2b',
- ),
- array(
- 'key' => 'field_6776f8d51ad2d',
- 'label' => 'Map Name',
- 'name' => 'key',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '50',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'maxlength' => '',
- 'allow_in_bindings' => 0,
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'parent_repeater' => 'field_6776f8361ad2b',
- ),
- ),
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'post_type',
- 'operator' => '==',
- 'value' => 'acffb-integration',
- ),
- ),
- ),
- 'menu_order' => 0,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 1,
- ) );
- } );
- }
-
- /**
- * Register custom admin columns for Integrations
- *
- * @return void
- */
- private function admin_columns(): void {
- add_filter(
- 'manage_' . self::POST_TYPE . '_posts_columns',
- function( array $columns ): array {
- $new_columns = [];
- foreach ( $columns as $key => $column ) {
- if ( 'date' === $key ) {
- continue;
- }
-
- $new_columns[ $key ] = 'title' === $key ? __( 'Integration', 'viget-form-blocks' ) : $column;
-
- if ( 'title' === $key ) {
- $new_columns['_vgtfb_form_id'] = __( 'Form', 'viget-form-blocks' );
- $new_columns['third-party'] = __( 'Third-Party', 'viget-form-blocks' );
- }
- }
-
- return $new_columns;
- }
- );
-
- add_action(
- 'manage_' . self::POST_TYPE . '_posts_custom_column',
- function( $column_name, $post_id ) {
- if ( 'third-party' === $column_name ) {
- $third_party = get_post_meta( $post_id, '_third_party', true );
- echo $third_party ? esc_html( $third_party ) : '—';
- return;
- }
- },
- 10,
- 2
- );
- }
-
- /**
- * Add the meta boxes to display the form integration data.
- *
- * @return void
- */
- private function meta_boxes(): void {
- add_action(
- 'add_meta_boxes',
- function() {
-// add_meta_box(
-// 'vgtfb_integration_settings',
-// __( 'Integration Settings', 'viget-form-blocks' ),
-// function( \WP_Post $post ): void {
-// echo 'Integration settings...';
-// },
-// self::POST_TYPE,
-// 'normal',
-// 'high'
-// );
-
- add_meta_box(
- 'vgtfb_integration_stats',
- __( 'Integration Stats', 'viget-form-blocks' ),
- function( \WP_Post $post ): void {
- $this->render_integration_stats( $post->ID );
- },
- self::POST_TYPE,
- 'side'
- );
-
- remove_meta_box( 'pageparentdiv', self::POST_TYPE, 'side' );
- }
- );
- }
-
- /**
- * Render the integration stats.
- *
- * @param int $post_id The Integration Post ID.
- *
- * @return void
- */
- private function render_integration_stats( int $post_id ): void {
- printf(
- '
-
-
-
',
- esc_attr( $post_id ),
- esc_html__( 'Send Test Request', 'viget-form-blocks' )
- );
- }
-
- /**
- * Handle the integration test request.
- *
- * @return void
- */
- private function handle_integration_test(): void {
- add_action(
- 'wp_ajax_vgtfb_integration_test',
- function() {
- if ( ! current_user_can( 'edit_posts' ) ) {
- wp_send_json_error( [ 'message' => __( 'Unauthorized.', 'viget-form-blocks' ) ] );
- }
-
- if ( ! check_ajax_referer( 'acffb', 'nonce', false ) ) {
- wp_send_json_error( [ 'message' => __( 'Invalid nonce.', 'viget-form-blocks' ) ] );
- }
-
- $integration_id = ! empty( $_POST['integrationId'] ) ? intval( sanitize_text_field( $_POST['integrationId'] ) ) : 0;
-
- if ( ! $integration_id ) {
- wp_send_json_error( [ 'message' => __( 'Integration not found.', 'viget-form-blocks' ) ] );
- }
-
- $integration = self::factory( $integration_id );
- $response = $integration->test();
-
- if ( is_wp_error( $response ) ) {
- wp_send_json_error( [ 'message' => $response->get_error_message() ] );
- }
-
- $status = wp_remote_retrieve_response_code( $response );
-
- wp_send_json_success( [ 'message' => $status ] );
- }
- );
- }
-
- /**
- * Populate the Form Field select with available fields.
- *
- * @return void
- */
- private function populate_fields_select(): void {
- add_filter(
- 'acf/prepare_field/key=field_6776f8701ad2c',
- function ( array $field ): array {
- $form_id = $this->get_current_form();
- $form = Form::find_form( $form_id );
-
- if ( ! $form ) {
- $field['choices'] = [
- '' => __( 'Select a form and update to see fields.', 'viget-form-blocks' ),
- ];
- return $field;
- }
-
- foreach ( $form->get_form_object()->get_all_fields() as $form_field ) {
- $field['choices'][ $form_field->get_id() ] = $form_field->get_label();
- }
-
- return $field;
- }
- );
- }
-
- /**
- * Get the current Integration Form ID
- *
- * @return ?string
- */
- private function get_current_form(): ?string {
- $post_id = ! empty( $_GET['post'] ) ? (int) $_GET['post'] : null;
- if ( ! $post_id ) {
- return null;
- }
-
- return get_field( '_vgtfb_form_id', $post_id ) ?: null;
- }
-
- /**
- * Get the integrations for the form.
- *
- * @param string $form_id The Form ID.
- *
- * @return array
- */
- public static function get_integrations( string $form_id ): array {
- $query = new WP_Query(
- [
- 'post_type' => self::POST_TYPE,
- 'post_status' => 'publish',
- 'posts_per_page' => -1,
- 'meta_query' => [
- [
- 'key' => '_vgtfb_form_id',
- 'value' => $form_id,
- ],
- ],
- ]
- );
-
- if ( ! $query->have_posts() ) {
- return [];
- }
-
- $integrations = [];
-
- while ( $query->have_posts() ) {
- $query->the_post();
- $integrations[] = self::factory( get_the_ID() );
- }
- wp_reset_postdata();
-
- return $integrations;
- }
-
- /**
- * Get the Integration Type
- *
- * @param ?int $post_id
- *
- * @return string
- */
- public static function get_type( ?int $post_id = null ): string {
- if ( ! $post_id ) {
- $post_id = get_the_ID();
- }
-
- $type = get_post_meta( $post_id, '_vgtfb_type', true );
-
- if ( ! $type ) {
- return 'request';
- }
-
- return $type;
- }
-
- /**
- * Get the Integration instance by type
- *
- * @param int $id The Integration ID.
- *
- * @return BaseIntegration
- */
- public static function factory( int $id ): BaseIntegration {
- $type = self::get_type( $id );
-
- if ( str_contains( $type, '\\' ) ) {
- $class = $type;
- } else {
- $class = 'VigetFormBlocks\\Integrations\\' . ucfirst( $type );
- }
-
- if ( class_exists( $class ) ) {
- return new $class( $id );
- }
-
- return new BaseIntegration( $id );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Admin/Submission.php b/wp-content/plugins/viget-form-blocks/classes/Admin/Submission.php
deleted file mode 100644
index 3063d666..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Admin/Submission.php
+++ /dev/null
@@ -1,469 +0,0 @@
-register_post_type();
-
- // Customize admin columns
- $this->admin_columns();
-
- // Add Submission Filters by Form ID.
- $this->admin_filters();
-
- // Register the meta boxes.
- $this->meta_boxes();
- }
-
- /**
- * Register the Submission post type.
- *
- * @return void
- */
- private function register_post_type(): void {
- add_action(
- 'init',
- function() {
- $labels = [
- 'name' => _x( 'Submissions', 'Post Type General Name', 'viget-form-blocks' ),
- 'singular_name' => _x( 'Submission', 'Post Type Singular Name', 'viget-form-blocks' ),
- 'menu_name' => __( 'Submissions', 'viget-form-blocks' ),
- 'name_admin_bar' => __( 'Submission', 'viget-form-blocks' ),
- 'archives' => '',
- 'attributes' => __( 'Submission Attributes', 'viget-form-blocks' ),
- 'parent_item_colon' => __( 'Parent Submission:', 'viget-form-blocks' ),
- 'all_items' => __( 'All Submissions', 'viget-form-blocks' ),
- 'add_new_item' => '',
- 'add_new' => '',
- 'new_item' => '',
- 'edit_item' => __( 'Edit Submission', 'viget-form-blocks' ),
- 'update_item' => __( 'Update Submission', 'viget-form-blocks' ),
- 'view_item' => __( 'View Submission', 'viget-form-blocks' ),
- 'view_items' => __( 'View Submissions', 'viget-form-blocks' ),
- 'search_items' => __( 'Search Submission', 'viget-form-blocks' ),
- 'not_found' => __( 'Not found', 'viget-form-blocks' ),
- 'not_found_in_trash' => __( 'Not found in Trash', 'viget-form-blocks' ),
- 'featured_image' => __( 'Featured Image', 'viget-form-blocks' ),
- 'set_featured_image' => __( 'Set featured image', 'viget-form-blocks' ),
- 'remove_featured_image' => __( 'Remove featured image', 'viget-form-blocks' ),
- 'use_featured_image' => __( 'Use as featured image', 'viget-form-blocks' ),
- 'insert_into_item' => __( 'Insert into submission', 'viget-form-blocks' ),
- 'uploaded_to_this_item' => __( 'Uploaded to this submission', 'viget-form-blocks' ),
- 'items_list' => __( 'Submissions list', 'viget-form-blocks' ),
- 'items_list_navigation' => __( 'Submissions list navigation', 'viget-form-blocks' ),
- 'filter_items_list' => __( 'Filter submissions list', 'viget-form-blocks' ),
- ];
- $args = [
- 'label' => __( 'Submission', 'viget-form-blocks' ),
- 'description' => __( 'Form Block Submissions', 'viget-form-blocks' ),
- 'labels' => $labels,
- 'supports' => [ 'title' ],
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => 'acffb-forms',
- 'menu_position' => 10,
- 'menu_icon' => 'dashicons-feedback',
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => false,
- 'can_export' => true,
- 'has_archive' => false,
- 'exclude_from_search' => true,
- 'publicly_queryable' => true,
- 'rewrite' => false,
- 'capability_type' => 'page',
- ];
-
- register_post_type( self::POST_TYPE, $args );
- }
- );
- }
-
- /**
- * Register custom admin columns for Submissions
- *
- * @return void
- */
- private function admin_columns(): void {
- add_filter(
- 'manage_' . self::POST_TYPE . '_posts_columns',
- function( array $columns ): array {
- $new_columns = [];
- foreach ( $columns as $key => $column ) {
- $new_columns[ $key ] = $column;
- if ( 'title' === $key ) {
- $new_columns['form'] = __( 'Form', 'viget-form-blocks' );
- $new_columns['page'] = __( 'Page', 'viget-form-blocks' );
- }
- }
-
- return $new_columns;
- }
- );
-
- add_action(
- 'manage_' . self::POST_TYPE . '_posts_custom_column',
- function( $column_name, $post_id ) {
- if ( 'form' === $column_name ) {
- $form = $this->get_form( $post_id );
-
- if ( ! $form ) {
- printf(
- '%s',
- esc_attr( $this->get_form_id( $post_id ) ),
- esc_html__( 'Unknown', 'viget-form-blocks' )
- );
- return;
- }
-
- printf(
- '%s',
- esc_attr( $form->get_form_object()->get_id() ),
- esc_html( $form->get_form_object()->get_name() )
- );
-
- return;
- }
-
- if ( 'page' === $column_name ) {
- $page_id = get_post_meta( $post_id, '_post_id', true );
- if ( $page_id ) {
- printf(
- '%s',
- esc_url( get_edit_post_link( $page_id ) ),
- esc_html( get_the_title( $page_id ) )
- );
- }
- return;
- }
- },
- 10,
- 2
- );
- }
-
- /**
- * Get the forms list with Submissions.
- *
- * @return array
- */
- private function get_forms_list(): array {
- $forms = [];
-
- $post_status = ! empty( $_GET['post_status'] ) ? sanitize_text_field( $_GET['post_status'] ) : 'publish';
-
- $this->disable_admin_filters();
- $submissions = new WP_Query(
- [
- 'post_type' => self::POST_TYPE,
- 'posts_per_page' => -1,
- 'fields' => 'ids',
- 'post_status' => $post_status,
- ]
- );
- $this->apply_admin_filters();
-
- foreach ( $submissions->posts as $post_id ) {
- $form = $this->get_form( $post_id );
- if ( ! $form ) {
- continue;
- }
-
- $form_id = $form->get_form_object()->get_id();
- $form_name = $form->get_form_object()->get_name();
-
- if ( empty( $forms[ $form_id ] ) ) {
- $forms[ $form_id ] = $form_name . ' (...' . substr( $form_id, -5 ) . ')';
- } else {
- if ( ! str_contains( $forms[ $form_id ], $form_name ) ) {
- $forms[ $form_id ] .= ' ' . __( 'aka', 'viget-form-blocks' ) . ' ' . $form_name;
- }
- }
- }
-
- return $forms;
- }
-
- /**
- * Get the form instance.
- *
- * @param ?int $post_id The post ID.
- *
- * @return ?Form
- */
- private function get_form( ?int $post_id = null ): ?Form {
- if ( ! $post_id ) {
- $post_id = get_the_ID();
- }
-
- $form_meta = get_post_meta( $post_id, '_form', true );
-
- if ( ! $form_meta ) {
- return null;
- }
-
- $markup = $form_meta['markup'] ?? '';
- $context = $form_meta['context'] ?? [];
- $form_id = $this->get_form_id( $post_id );
- $form = Form::get_instance( $form_id, $markup, $context );
-
- $form_name = get_post_meta( $post_id, '_form_name', true );
- if ( $form_name ) {
- $form->get_form_object()->set_name( $form_name );
- }
-
- $form->preload_meta();
- $form->get_form_object()->update_field_context();
- $form->update_cache();
-
- return $form;
- }
-
- /**
- * Get the form ID.
- *
- * @param ?int $post_id The post ID.
- *
- * @return ?string
- */
- private function get_form_id( ?int $post_id = null ): ?string {
- if ( ! $post_id ) {
- $post_id = get_the_ID();
- }
-
- $form_id = get_post_meta( $post_id, '_form_id', true );
-
- if ( $form_id ) {
- return $form_id;
- }
-
- $form_meta = get_post_meta( $post_id, '_form', true );
-
- return ! empty( $form_meta['id'] ) ? $form_meta['id'] : null;
- }
-
- /**
- * Add the meta boxes to display the form submission data.
- *
- * @return void
- */
- private function meta_boxes(): void {
- add_action(
- 'add_meta_boxes',
- function() {
- add_meta_box(
- 'vgtfb_submission_data',
- __( 'Submission Data', 'viget-form-blocks' ),
- function( \WP_Post $post ): void {
- $content = $post->post_content ? json_decode( $post->post_content, true ) : [];
- if ( ! $content ) {
- printf(
- '%s %s:
',
- esc_html__( 'There was a problem rendering the submission data.', 'viget-form-blocks' ),
- esc_html__( 'Raw Submission Data', 'viget-form-blocks' )
- );
-
- printf(
- '%s
',
- esc_html( $post->post_content )
- );
- return;
- }
-
- $this->render_submission_content( $content );
- },
- self::POST_TYPE,
- 'normal',
- 'high'
- );
-
- add_meta_box(
- 'vgtfb_submission_meta',
- __( 'Submission Meta', 'viget-form-blocks' ),
- function( \WP_Post $post ): void {
- $this->render_submission_meta( $post->ID );
- },
- self::POST_TYPE,
- 'side'
- );
-
- add_meta_box(
- 'vgtfb_submission_confirmation',
- __( 'Confirmation Details', 'viget-form-blocks' ),
- function( \WP_Post $post ): void {
- $this->render_confirmation( $post->ID );
- },
- self::POST_TYPE,
- 'side'
- );
-
- add_meta_box(
- 'vgtfb_submission_notifications',
- __( 'Notifications', 'viget-form-blocks' ),
- function( \WP_Post $post ): void {
- $this->render_notifications( $post->ID );
- },
- self::POST_TYPE,
- 'side'
- );
-
- remove_meta_box( 'pageparentdiv', self::POST_TYPE, 'side' );
- }
- );
- }
-
- /**
- * Render the submission content.
- *
- * @param array $content Submission content.
- *
- * @return void
- */
- private function render_submission_content( array $content ): void {
- Views::render( 'templates/all-fields', [ 'form' => $this->get_form(), 'content' => $content ] );
- }
-
- /**
- * Render the submission content.
- *
- * @param string $field_key Field Key.
- *
- * @return bool
- */
- public static function has_rendered( string $field_key ): bool {
- if ( in_array( $field_key, self::$rendered, true ) ) {
- return true;
- }
-
- self::$rendered[] = $field_key;
- return false;
- }
-
- /**
- * Render the Submission Meta data
- *
- * @param int $post_id
- * @param array $excluded
- * @param array $included
- *
- * @return void
- */
- private function render_meta( int $post_id, array $excluded = [], array $included = [] ): void {
- $form_meta = get_post_meta( $post_id, '_form', true );
- $form = Form::get_instance( $form_meta['id'], $form_meta['markup'], $form_meta['context'], 'content' );
-
- $form->load_meta( $post_id );
-
- foreach ( $form->get_meta() as $meta_field ) {
- if ( in_array( $meta_field->get_key(), $excluded, true ) ) {
- continue;
- }
-
- if ( ! empty( $included ) && ! in_array( $meta_field->get_key(), $included, true ) ) {
- continue;
- }
-
- $value = $meta_field->get_value( null, true );
- $label = $meta_field->get_label();
-
- if ( is_array( $value ) ) {
- foreach ( $value as $key => $val ) {
- if ( in_array( $key, $excluded, true ) ) {
- continue;
- }
-
- if ( ! empty( $included ) && ! in_array( $meta_field->get_key(), $included, true ) ) {
- continue;
- }
-
- printf(
- '%s: %s
',
- esc_html( $meta_field->get_label( $key ) ),
- $val ? wp_kses_post( $val ) : $val
- );
- }
-
- return;
- }
-
- printf(
- '%s: %s
',
- esc_html( $label ),
- $value ? wp_kses_post( $value ) : ''
- );
- }
- }
-
- /**
- * Render the submission meta.
- *
- * @param int $post_id The Submission Post ID.
- *
- * @return void
- */
- private function render_submission_meta( int $post_id ): void {
- $excluded = [
- 'markup',
- 'context',
- '_confirmation',
- '_notifications',
- ];
-
- $this->render_meta( $post_id, $excluded );
- }
-
- /**
- * Render the confirmation data.
- *
- * @param int $post_id The Submission Post ID.
- *
- * @return void
- */
- private function render_confirmation( int $post_id ): void {
- $this->render_meta( $post_id, [], [ '_confirmation' ] );
- }
-
- /**
- * Render the notifications data.
- *
- * @param int $post_id The Submission Post ID.
- *
- * @return void
- */
- private function render_notifications( int $post_id ): void {
- $this->render_meta( $post_id, [], [ '_notifications' ] );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Blocks/AllFieldsBlock.php b/wp-content/plugins/viget-form-blocks/classes/Blocks/AllFieldsBlock.php
deleted file mode 100644
index 3fec533e..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Blocks/AllFieldsBlock.php
+++ /dev/null
@@ -1,48 +0,0 @@
-get_form() ) {
- return $block_content;
- }
-
- $data = $this->get_form()->get_submission()->get_data();
- return Views::get(
- 'templates/all-fields',
- [
- 'form' => $this->get_form(),
- 'content' => $data['content'],
- 'block' => $this,
- ]
- );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Blocks/Block.php b/wp-content/plugins/viget-form-blocks/classes/Blocks/Block.php
deleted file mode 100644
index e175a8ca..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Blocks/Block.php
+++ /dev/null
@@ -1,232 +0,0 @@
-block_names = $block_names;
-
- // Template redirect actions.
- $this->template_redirect();
-
- // Filter the block during render
- $this->render_block();
- }
-
- /**
- * Get the Block array
- *
- * @return array
- */
- public function get_block(): array {
- if ( empty( $this->block ) ) {
- $context = [ 'postType' => get_post_type(), 'postId' => get_the_ID() ];
- $this->block = Blocks::prepare_acf_block( $this->wp_block, $context );
- }
-
- return $this->block;
- }
-
- /**
- * Get the WP Block array
- *
- * @return array
- */
- public function get_wp_block(): array {
- return $this->wp_block;
- }
-
- /**
- * Get the block data.
- *
- * @param string $selector Field selector.
- * @param mixed $default Default value.
- *
- * @return mixed
- */
- public function get_block_data( string $selector, mixed $default = null ): mixed {
- $this->preload_meta();
-
- $value = get_field( $selector );
-
- if ( ! is_null( $value ) ) {
- return $value;
- }
-
- $value = get_field( $selector, $this->get_acf_id() );
-
- if ( ! is_null( $value ) ) {
- return $value;
- }
-
- if ( ! empty( $this->wp_block['attrs']['data'][ $selector ] ) ) {
- return $this->wp_block['attrs']['data'][ $selector ];
- }
-
- return $default;
- }
-
- /**
- * Get the block ACF ID
- *
- * @return string
- */
- public function get_acf_id(): string {
- return get_block_id( $this->get_block(), true );
- }
-
- /**
- * Template redirect.
- *
- * @return void
- */
- private function template_redirect(): void {
- add_action(
- 'template_redirect',
- function() {
- if ( ! $this->form ) {
- $posted_form = $_REQUEST[ Form::HIDDEN_FORM_ID ] ?? null;
- if ( ! $posted_form ) {
- return;
- }
-
- $this->form = Form::get_instance( $posted_form );
-
- // Skip if we don't have a form.
- if ( ! $this->form ) {
- return;
- }
- }
-
- $this->do_template_redirect();
- }
- );
- }
-
- /**
- * Get the Form Object
- *
- * @return ?Form
- */
- public function get_form(): ?Form {
- return $this->form;
- }
-
- /**
- * Filter the block during render.
- *
- * @return void
- */
- private function render_block(): void {
- add_filter(
- 'render_block',
- function ( string $block_content, array $block ): string {
- if ( ! in_array( $block['blockName'], $this->block_names, true ) ) {
- return $block_content;
- }
-
- $this->wp_block = $block;
-
- $this->preload_meta();
-
- return $this->render( $block_content );
- },
- 10,
- 2
- );
- }
-
- /**
- * Preload the meta data.
- *
- * @return void
- */
- public function preload_meta(): void {
- add_filter(
- 'acf/pre_load_metadata',
- function ( $null, $post_id, $name, $hidden ) {
- $name = ( $hidden ? '_' : '' ) . $name;
- return $this->wp_block['data'][ $name ] ?? $null;
- },
- 5,
- 4
- );
- }
-
- /**
- * Do template redirect.
- *
- * @return void
- */
- public function do_template_redirect(): void {
- // Do nothing.
- }
-
- /**
- * Apply the render filter.
- *
- * @param string $block_content The block content.
- *
- * @return string
- */
- public function render( string $block_content ): string {
- return $block_content;
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Blocks/FormBlock.php b/wp-content/plugins/viget-form-blocks/classes/Blocks/FormBlock.php
deleted file mode 100644
index b782028e..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Blocks/FormBlock.php
+++ /dev/null
@@ -1,33 +0,0 @@
-form->get_submission()->process();
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Blocks/FormDataBlock.php b/wp-content/plugins/viget-form-blocks/classes/Blocks/FormDataBlock.php
deleted file mode 100644
index 98d1978c..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Blocks/FormDataBlock.php
+++ /dev/null
@@ -1,48 +0,0 @@
-get_form() ) {
- return $block_content;
- }
-
- $data = $this->get_form()->get_submission()->get_data();
- return Views::get(
- 'templates/form-data/default',
- [
- 'form' => $this->get_form(),
- 'content' => $data['content'],
- 'block' => $this,
- ]
- );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Blocks/FormMetaBlock.php b/wp-content/plugins/viget-form-blocks/classes/Blocks/FormMetaBlock.php
deleted file mode 100644
index 4af8b689..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Blocks/FormMetaBlock.php
+++ /dev/null
@@ -1,48 +0,0 @@
-get_form() ) {
- return $block_content;
- }
-
- $data = $this->get_form()->get_submission()->get_data();
- return Views::get(
- 'templates/form-meta/default',
- [
- 'form' => $this->get_form(),
- 'meta' => $data['meta'],
- 'block' => $this,
- ]
- );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Blocks/SubmitBlock.php b/wp-content/plugins/viget-form-blocks/classes/Blocks/SubmitBlock.php
deleted file mode 100644
index fbb1b5ed..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Blocks/SubmitBlock.php
+++ /dev/null
@@ -1,37 +0,0 @@
-', '', $block_content );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Confirmation.php b/wp-content/plugins/viget-form-blocks/classes/Confirmation.php
deleted file mode 100644
index a36d2482..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Confirmation.php
+++ /dev/null
@@ -1,145 +0,0 @@
-form_id = $form->get_form_object()->get_id();
-
- // Add the hooks.
- $this->add_hooks();
- }
-
- /**
- * Add the hooks.
- *
- * @return void
- */
- private function add_hooks(): void {
- // Handle redirect.
- add_action( 'vgtfb_process_submission', [ $this, 'handle_redirect' ], 999 );
- }
-
- /**
- * Get the form instance.
- *
- * @return ?Form
- */
- public function get_form(): ?Form {
- return Form::find_form( $this->form_id );
- }
-
- /**
- * Handle the redirect.
- *
- * @return void
- */
- public function handle_redirect(): void {
- if ( 'redirect' !== $this->get_type() ) {
- return;
- }
-
- wp_safe_redirect( $this->get_redirect() );
- exit;
- }
-
- /**
- * Get the confirmation type.
- *
- * @return string
- */
- public function get_type(): string {
- $confirmation = $this->get_form()?->get_form_object()->get_form_data( 'confirmation' );
-
- if ( ! $confirmation ) {
- return 'message';
- }
-
- return $confirmation;
- }
-
- /**
- * Get the confirmation message.
- *
- * @return string
- */
- public function get_message(): string {
- $message = $this->get_form()?->get_form_object()->get_form_data( 'message' );
-
- if ( ! $message ) {
- return __( 'Thank you for your submission.', 'viget-form-blocks' );
- }
-
- return $message;
- }
-
- /**
- * Get the redirect URL.
- *
- * @return string
- */
- public function get_redirect(): string {
- $form = $this->get_form();
- $custom = $form?->get_form_object()->get_form_data( 'custom_url' );
-
- if ( $custom ) {
- $redirect = $form?->get_form_object()->get_form_data( 'redirect' );
- } else {
- $page = $form?->get_form_object()->get_form_data( 'page' );
- $redirect = $page ? get_permalink( $page->ID ) : false;
- }
-
- if ( ! $redirect ) {
- return '';
- }
-
- return $redirect;
- }
-
- /**
- * Render the confirmation.
- *
- * @return void
- */
- public function render(): void {
- $form = $this->get_form();
- ?>
-
- get_type() ) {
- $page = $form?->get_form_object()->get_form_data( 'page' );
- if ( $page ) {
- $page = is_numeric( $page ) ? get_post( $page ) : $page;
- echo apply_filters( 'the_content', $page?->post_content );
- }
- } else {
- printf(
- '
%s
',
- wp_kses_post($this->get_message())
- );
- }
- ?>
-
- get();
- }
-
- /**
- * Get the value attribute of the checkbox.
- *
- * @return string
- */
- public function get_value_attr(): string {
- $custom_value = $this->get_field_data( 'checkbox_value', false );
- $value = $this->get_field_data( 'value', 1 );
-
- if ( ! $custom_value ) {
- $value = $this->get_label();
- }
-
- return $value;
- }
-
- /**
- * Whether the checkbox should be checked or not.
- *
- * @return bool
- */
- public function is_checked(): bool {
- if ( ! $this->get_fieldset() ) {
- return $this->get_value_attr() === parent::get_value();
- }
-
- $values = $this->get_fieldset()->get_value() ?: [];
-
- if ( in_array( $this->get_value(), $values, true ) ) {
- return true;
- }
-
- return false;
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Color.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Color.php
deleted file mode 100644
index 34694211..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Color.php
+++ /dev/null
@@ -1,22 +0,0 @@
-block = $block;
- $this->context = $context;
- $this->wp_block = $wp_block;
-
- if ( ! empty( $block['parent_id'] ) ) {
- $this->parent_id = $block['parent_id'];
- }
- if ( ! empty( $block['pattern_id'] ) ) {
- $this->pattern_id = $block['pattern_id'];
- }
- }
-
- /**
- * Get attributes for this field.
- *
- * @return array
- */
- public function get_attrs(): array {
- $attrs = [
- 'id' => $this->get_id_attr(),
- 'name' => $this->get_name_attr(),
- ];
-
- if ( $this->get_placeholder() ) {
- $attrs['placeholder'] = $this->get_placeholder();
- }
-
- if ( $this->is_required() ) {
- $attrs['required'] = true;
- }
-
- $logic = $this->get_conditional_logic();
- if ( ! is_admin() && $logic ) {
- $attrs['data-conditional-rules'] = wp_json_encode( $logic );
- }
-
- return $attrs;
- }
-
- /**
- * Get the field type.
- *
- * @return ?string
- */
- public function get_type(): ?string {
- return $this->get_field_data( 'type' );
- }
-
- /**
- * Factory method to create a new field object.
- *
- * @param array $block Block data.
- * @param array $context Context data.
- * @param ?WP_Block $wp_block WP Block object.
- * @param ?Form $form The Form Element object.
- *
- * @return Field
- */
- public static function factory( array $block, array $context = [], ?WP_Block $wp_block = null, ?Form $form = null ): Field {
- $element = str_replace( 'acf/', '', $block['name'] );
- $class = __NAMESPACE__ . '\\' . ucfirst( $element );
-
- if ( class_exists( $class ) ) {
- // Input handler.
- if ( 'input' === $element ) {
- $input = new $class( $block, $context, $wp_block, $form );
- $type = __NAMESPACE__ . '\\' . ucfirst( $input->get_input_type() );
-
- if ( class_exists( $type ) ) {
- return new $type( $block, $context, $wp_block, $form );
- }
- }
-
- return new $class( $block, $context, $wp_block, $form );
- }
-
- return new Field( $block, $context, $wp_block, $form );
- }
-
- /**
- * Get the block array.
- *
- * @return array
- */
- public function get_block(): array {
- return $this->block;
- }
-
- /**
- * Get the block context.
- *
- * @param string $key
- *
- * @return mixed
- */
- public function get_context( string $key = '' ): mixed {
- $context = $this->context ?? $this->wp_block?->context ?? [];
-
- if ( ! $key ) {
- return $context;
- }
-
- if ( ! isset( $context[ $key ] ) ) {
- return null;
- }
-
- return $context[ $key ];
- }
-
- /**
- * Set the field context manually.
- *
- * @param array $new_context
- *
- * @return void
- */
- public function set_context( array $new_context ): void {
- $context = $this->get_context();
-
- if ( empty( $context ) ) {
- $this->context = $new_context;
- return;
- }
-
- $this->context = array_merge( $context, $new_context );
- }
-
- /**
- * Get the form object.
- *
- * @return ?Form
- */
- public function get_form(): ?Form {
- return Form::find_form( $this->get_context( 'acffb/formId' ) );
- }
-
- /**
- * Get the fieldset.
- *
- * @return ?Field
- */
- public function get_fieldset(): ?Field {
- if ( ! $this->get_context( 'acffb/fieldsetId' ) ) {
- return null;
- }
-
- $fieldset_id = 'acf_field_' . $this->get_context( 'acffb/fieldsetId' );
- return $this->get_form()?->get_form_object()->get_field_by_id( $fieldset_id );
- }
-
- /**
- * Get the parent field.
- *
- * @return ?Field
- */
- public function get_parent_field(): ?Field {
- if ( ! $this->get_context( 'acffb/fieldId' ) ) {
- return null;
- }
-
- $input_id = 'acf_field_' . $this->get_context( 'acffb/fieldId' );
-
- return $this->get_form()?->get_form_object()->get_field_by_id( $input_id );
- }
-
- /**
- * Get the block ACF ID
- *
- * @return string
- */
- public function get_acf_id(): string {
- return get_block_id( $this->block, true );
- }
-
- /**
- * Get the field ID attribute.
- *
- * @return string
- */
- public function get_id_attr(): string {
- if ( ! empty( $this->block['anchor'] ) ) {
- return $this->block['anchor'];
- }
-
- return $this->get_name();
- }
-
- /**
- * Get the field unique ID.
- *
- * @return string
- */
- public function get_id(): string {
- return $this->get_name();
- }
-
- /**
- * Get the field name (the actual ID).
- *
- * @return string
- */
- public function get_name(): string {
- if ( empty( $this->block['blockId'] ) ) {
- return $this->get_acf_id();
- }
-
- $block_name = $this->get_block_name( true );
- $block_name = str_replace( '/', '_', $block_name );
- $prefix = 'acf_form' === $block_name ? $block_name : 'acf_field';
- return $prefix . '_' . $this->block['blockId'];
- }
-
- /**
- * Get the name attribute.
- *
- * @return string
- */
- public function get_name_attr(): string {
- if ( $this->get_fieldset() ) {
- return sprintf(
- '%s[%s]',
- $this->get_fieldset()->get_name(),
- $this->get_name()
- );
- }
-
- return $this->get_name();
- }
-
- /**
- * Get the block name
- *
- * @param bool $real If actual block name is needed.
- *
- * @return string
- */
- public function get_block_name( bool $real = false ): string {
- $name = $this->block['blockName'] ?? $this->block['name'] ?? '';
-
- if ( $real ) {
- return $name;
- }
-
- return str_replace( 'acf/', '', $name );
- }
-
- /**
- * Get the default value.
- *
- * @return mixed
- */
- public function get_default_value(): mixed {
- return $this->default_value;
- }
-
- /**
- * Set the default value.
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_default_value( mixed $value ): void {
- $this->default_value = $value;
- }
-
- /**
- * Get the field value.
- *
- * @return mixed
- */
- public function get_value(): mixed {
- $value = $this->get_form()?->get_submission()->get_field_data( $this->get_name() );
- return $value ?: $this->get_default_value();
- }
-
- /**
- * Get the dummy value.
- *
- * @return mixed
- */
- public function get_dummy_value(): mixed {
- if ( $this->get_value() ) {
- return $this->get_value();
- }
-
- return 'Abc123';
- }
-
- /**
- * Get the field label.
- *
- * @return string
- */
- public function get_field_label(): string {
- if ( ! empty( $this->block['metadata']['name'] ) ) {
- return trim( $this->block['metadata']['name'] );
- }
-
- return $this->get_label();
- }
-
- /**
- * Get the field label.
- *
- * @return string
- */
- public function get_label(): string {
- $inner_blocks = [];
-
- if ( ! empty( $this->wp_block->parsed_block['innerBlocks'] ) ) {
- $inner_blocks = $this->wp_block->parsed_block['innerBlocks'];
- } elseif ( ! empty( $this->block['wp_block']['innerBlocks'] ) ) {
- $inner_blocks = $this->block['wp_block']['innerBlocks'];
- }
-
- if ( ! empty( $inner_blocks ) ) {
- $label = $this->find_label( $inner_blocks );
-
- if ( $label ) {
- return $label;
- }
- }
-
- return $this->get_id();
- }
-
- /**
- * Find the label in the inner blocks.
- *
- * @param array $inner_blocks
- *
- * @return string
- */
- private function find_label( array $inner_blocks ): string {
- $label = '';
-
- foreach ( $inner_blocks as $inner_block ) {
- if ( 'core/paragraph' === $inner_block['blockName'] ) {
- $label = wp_strip_all_tags( $inner_block['innerHTML'] );
- break;
- }
-
- if ( 'submit' === $this->get_block_name() && 'core/button' === $inner_block['blockName'] ) {
- $label = wp_strip_all_tags( $inner_block['innerHTML'] );
- break;
- }
-
- $label = wp_strip_all_tags( $inner_block['innerHTML'] );
-
- if ( $label ) {
- break;
- }
-
- if ( empty( $inner_block['innerBlocks'] ) ) {
- continue;
- }
-
- $nested_blocks = [
- 'acf/legend',
- 'acf/label',
- 'core/buttons',
- 'core/group',
- ];
-
- if ( in_array( $inner_block['blockName'], $nested_blocks, true ) ) {
- $label = $this->find_label( $inner_block['innerBlocks'] );
-
- if ( $label ) {
- break;
- }
- }
- }
-
- return $label;
- }
-
- /**
- * Get the field data.
- *
- * @param string $selector Field selector.
- * @param mixed $default Default value.
- *
- * @return mixed
- */
- public function get_field_data( string $selector, mixed $default = null ): mixed {
- $this->preload_meta();
-
- $value = get_field( $selector );
-
- if ( ! is_null( $value ) ) {
- return $value;
- }
-
- $value = get_field( $selector, $this->get_acf_id() );
-
- if ( ! is_null( $value ) ) {
- return $value;
- }
-
- return $default;
- }
-
- /**
- * Preload the meta data.
- *
- * @return void
- */
- private function preload_meta(): void {
- add_filter(
- 'acf/pre_load_metadata',
- function ( $null, $post_id, $name, $hidden ) {
- $meta = $this->get_field_meta();
- $name = ( $hidden ? '_' : '' ) . $name;
-
- if ( isset( $meta[ $post_id ] ) ) {
- if ( isset( $meta[ $post_id ][ $name ] ) ) {
- return $meta[ $post_id ][ $name ];
- }
- return '__return_null';
- }
-
- return $null;
- },
- 5,
- 4
- );
- }
-
- /**
- * Get the field meta.
- *
- * @return array
- */
- private function get_field_meta(): array {
- return [
- $this->get_acf_id() => $this->block['data'] ?? [],
- ];
- }
-
- /**
- * Check if the field is required.
- *
- * @return bool
- */
- public function is_required(): bool {
- return boolval( $this->get_field_data( 'required', false ) );
- }
-
- /**
- * Get the required marker placement.
- *
- * @return string
- */
- public function get_marker_placement(): string {
- return $this->req_marker_placement;
- }
-
- /**
- * Get the field placeholder.
- *
- * @return string
- */
- public function get_placeholder(): string {
- return $this->get_field_data( 'placeholder', '' );
- }
-
- /**
- * Get Conditional logic rules for field.
- *
- * @return ?array
- */
- public function get_conditional_logic(): ?array {
- if ( ! in_array( $this->get_block_name( true ), Form::ALL_FIELD_TYPES, true ) ) {
- return null;
- }
-
- if ( ! $this->get_field_data( 'enable_conditional_logic' ) ) {
- return null;
- }
-
- $logic = $this->get_field_data( 'conditional_logic' );
-
- if ( empty( $logic ) || ! is_array( $logic ) ) {
- return null;
- }
-
- if ( 'fieldset' === $this->get_block_name() ) {
- $container = sprintf( '#%s', $this->get_id_attr() );
- } else {
- $container = sprintf( 'div.form-input:has(#%s)', $this->get_id_attr() );
- }
-
- if ( empty( $logic[0]['action'] ) ) {
- return null;
- }
-
- $action = $logic[0]['action'];
- $rules = [
- 'container' => $container,
- 'action' => $action,
- 'logic' => 'and',
- 'rules' => [],
- ];
-
- foreach ( $logic as $item ) {
- $rules['rules'][] = [
- 'name' => $item['field'],
- 'operator' => $item['condition'],
- 'value' => $item['value'] ?? '',
- ];
- }
-
-// error_log( print_r( $rules, true ) );
-
- return $rules;
- }
-
- /**
- * Get the block template.
- *
- * @return array
- */
- public function get_template(): array {
- return [];
- }
-
- /**
- * Sanitize input from the field
- *
- * @param mixed $input
- * @param ?Form $form
- *
- * @return string|array
- */
- public function sanitize_input( mixed $input = null, ?Form $form = null ): string|array {
- if ( is_null( $input ) ) {
- if ( ! isset( $_REQUEST[ $this->get_name() ] ) ) {
- return '';
- }
-
- $input = ! is_array( $_REQUEST[ $this->get_name() ] ) ? trim( $_REQUEST[ $this->get_name() ] ) : array_filter( $_REQUEST[ $this->get_name() ] );
- }
-
- if ( empty( $input ) && '0' !== $input ) {
- return '';
- }
-
- if ( is_array( $input ) ) {
- return array_map(
- fn( $item ) => $this->sanitize_input( $item, $form ),
- $input
- );
- }
-
- if ( 'textarea' === $this->get_block_name() ) {
- $input = sanitize_textarea_field( $input );
- return str_replace( [ "\n", "\r", "'" ], [ "\\n", "\\r", "\'" ], $input );
- }
-
- return sanitize_text_field( $input );
- }
-
- /**
- * Render the field value
- *
- * @param mixed $value
- * @param Form $form
- *
- * @return void
- */
- public function render_value( mixed $value, Form $form ): void {
- if ( empty( $value ) ) {
- echo '
';
- return;
- }
-
- if ( is_array( $value ) ) {
- printf(
- '%s
',
- print_r( $value, true )
- );
- } elseif ( 'textarea' === $this->get_block_name() ) {
- printf(
- '%s
',
- nl2br( esc_textarea( stripslashes( $value ) ) )
- );
- } else {
- printf(
- '%s
',
- esc_html( $value )
- );
- }
- }
-
- /**
- * Get the parent field ID.
- *
- * @return ?string
- */
- public function get_parent_id(): ?string {
- return $this->parent_id;
- }
-
- /**
- * Get the pattern ID.
- *
- * @return ?int
- */
- public function get_pattern_id(): ?int {
- return $this->pattern_id;
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Fieldset.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Fieldset.php
deleted file mode 100644
index a2902f13..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Fieldset.php
+++ /dev/null
@@ -1,149 +0,0 @@
-get_child_fields( $form );
-
- if ( empty( $children ) ) {
- parent::render_value( $value, $form );
- return;
- }
-
- if ( $this->is_checkbox_group() ) {
- $value = empty( $value ) ? [] : $value;
-
- echo '';
-
- /** @var Checkbox[] $children */
- foreach ( $children as $child ) {
- if ( is_admin() && Submission::has_rendered( $child->get_id() ) ) {
- continue;
- }
-
- $checked = in_array( $child->get_value_attr(), $value, true );
- $label = $child->get_value_attr();
- $cbx_label = '';
-
- if ( $label !== $child->get_label() ) {
- $cbx_label = sprintf( ' (%s)', esc_html( $child->get_label() ) );
- }
-
- printf(
- '- %s%s
',
- $checked ? ' class="checked"' : '',
- $checked ? '' : '',
- esc_html( $label ) . $cbx_label
- );
- }
-
- echo '
';
- return;
- }
-
- foreach ( $children as $child ) {
- if ( is_admin() && Submission::has_rendered( $child->get_id() ) ) {
- continue;
- }
-
- $rendered = false;
-
- echo '';
- printf(
- '
%s
',
- esc_attr( $child->get_id() ),
- esc_html( $child->get_label() )
- );
-
- if ( empty( $value ) ) {
- parent::render_value( $value, $form );
- $rendered = true;
- } else {
- foreach ( $value as $child_id => $val ) {
- if ( $child_id !== $child->get_id() ) {
- continue;
- }
-
- $rendered = true;
- $child->set_default_value( $val );
-
- $child->render_value( $val, $form );
- break;
- }
- }
-
- if ( ! $rendered ) {
- // Render an empty value.
- parent::render_value( '', $form );
- }
-
- echo '
';
- }
- }
-
- /**
- * Get the block template.
- *
- * @return array
- * @throws Exception
- */
- public function get_template(): array {
- return ( new Template() )
- ->add( ( new Block( 'acf/legend' ) ) )
- ->add( ( new Block( 'core/paragraph', [ 'placeholder' => __( 'Type / to add fields...', 'acf-field-blocks' ) ] ) ) )
- ->get();
- }
-
- /**
- * Whether the fieldset is a checkbox group.
- *
- * @return bool
- */
- public function is_checkbox_group(): bool {
- return 'checkbox' === $this->get_group_type();
- }
-
- /**
- * Whether the fieldset is a address group.
- *
- * @return bool
- */
- public function is_address_group(): bool {
- return 'address' === $this->get_group_type();
- }
-
- /**
- * Get the group type.
- *
- * @return string
- */
- public function get_group_type(): string {
- return $this->block['groupType'] ?? 'default';
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/File.php b/wp-content/plugins/viget-form-blocks/classes/Elements/File.php
deleted file mode 100644
index 08bc50bc..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/File.php
+++ /dev/null
@@ -1,102 +0,0 @@
-get_name() ] ?? null;
-
- if ( ! $upload || 4 === $upload['error'] ) {
- return [];
- }
-
- $upload_dir = wp_upload_dir();
- $folder_path = '/form-submissions';
- $upload_path = $upload_dir['basedir'] . $folder_path;
-
- // Make sure root directory is protected.
- if ( ! is_dir( $upload_path ) ) {
- wp_mkdir_p( $upload_path );
- file_put_contents( $upload_path . '/index.php', "get_form_object()->get_id();
- $folder_path .= $form_dir;
- $upload_path .= $form_dir;
-
- // Make sure upload directory is protected.
- if ( ! is_dir( $upload_path ) ) {
- wp_mkdir_p( $upload_path );
- file_put_contents( $upload_path . '/index.php', "get_validation()->add_error( $this, 'Failed to upload file.' );
- return [];
- }
-
- return [
- 'raw' => $upload,
- 'path' => $upload_path,
- 'url' => $upload_dir['baseurl'] . $folder_path,
- ];
- }
-
- /**
- * Render the input value.
- *
- * @param mixed $value Value to render.
- * @param Form $form Form object.
- *
- * @return void
- */
- public function render_value( mixed $value, Form $form ): void {
- if ( empty( $value ) ) {
- parent::render_value( $value, $form );
- return;
- }
-
- printf(
- '',
- esc_attr( $value['url'] ),
- esc_html__( 'View File', 'viget-form-blocks' )
- );
- }
-
- /**
- * Get the field value.
- *
- * @return mixed
- */
- public function get_value_attr(): mixed {
- $value = parent::get_value_attr();
- if ( ! $value ) {
- return '';
- }
-
- return $value['raw']['full_path'] ?? '';
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Form.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Form.php
deleted file mode 100644
index 9cf160b5..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Form.php
+++ /dev/null
@@ -1,487 +0,0 @@
-block = $block;
- $this->markup = $markup;
- $this->context = $context;
-
- if ( ! empty( $block['blockId'] ) ) {
- $this->form_id = FormObject::prefix_id($block['blockId'] );
- }
-
- if ( ! empty( $block['pattern_id'] ) ) {
- $this->pattern_id = intval( $block['pattern_id'] );
- }
- }
-
- /**
- * Get the block attributes.
- *
- * @return array
- */
- public function get_attrs(): array {
- $attrs = [
- 'method' => $this->get_method(),
- 'action' => '#' . $this->get_id_attr(),
- 'id' => $this->get_id_attr()
- ];
-
- if ( $this->has_field_type( 'input', 'file' ) ) {
- $attrs['enctype'] = 'multipart/form-data';
- }
-
- if ( is_admin() ) {
- $attrs['autocomplete'] = 'off';
- }
-
- return $attrs;
- }
-
- /**
- * Get the form.
- *
- * @return array
- */
- public function get_form(): array {
- return $this->block;
- }
-
- /**
- * Get the form markup.
- *
- * @return string
- */
- public function get_form_markup(): string {
- return $this->markup;
- }
-
- /**
- * Get the form context.
- *
- * @return array
- */
- public function get_form_context(): array {
- return $this->context;
- }
-
- /**
- * Get the ID attribute.
- *
- * @return string
- */
- public function get_id_attr(): string {
- if ( ! empty( $this->block['anchor'] ) ) {
- return $this->block['anchor'];
- }
-
- if ( empty( $this->block['blockId'] ) ) {
- return get_block_id( $this->block, true );
- }
-
- return FormObject::prefix_id( $this->block['blockId'] );
- }
-
- /**
- * Get the actual form ID (unique/constant).
- *
- * @return string
- */
- public function get_id(): string {
- if ( empty( $this->block['blockId'] ) ) {
- return get_block_id( $this->block, true );
- }
-
- return FormObject::prefix_id( $this->block['blockId'] );
- }
-
- /**
- * Get the block ACF ID
- *
- * @return string
- */
- public function get_acf_id(): string {
- return get_block_id( $this->block );
- }
-
- /**
- * Get the form name.
- *
- * @return string
- */
- public function get_name(): string {
- if ( $this->form_name ) {
- return $this->form_name;
- }
-
- if ( $this->get_pattern_id() ) {
- $pattern_title = get_the_title( $this->get_pattern_id() );
- if ( $pattern_title ) {
- return $pattern_title;
- }
- }
-
- if ( $this->get_form_meta( 'name' ) ) {
- return $this->get_form_meta( 'name' );
- }
-
- if ( ! in_array( get_post_type(), [ EmailTemplate::POST_TYPE, Integration::POST_TYPE, Submission::POST_TYPE ], true ) ) {
- return get_the_title(); // Use the current post title.
- }
-
- return __( 'Untitled', 'viget-form-blocks' );
- }
-
- /**
- * Get the form name with a unique identifier.
- *
- * @return string
- */
- public function get_unique_name(): string {
- $short_id = substr( $this->get_id(), -5 );
- return $this->get_name() . ' (...' . $short_id . ')';
- }
-
- /**
- * Set the form name.
- *
- * @param ?string $form_name
- *
- * @return void
- */
- public function set_name( ?string $form_name = null ): void {
- if ( ! $form_name ) {
- $form_name = $this->get_name();
- }
-
- $this->form_name = $form_name;
- }
-
- /**
- * Get the form action.
- *
- * @return string
- */
- public function get_method(): string {
- return $this->get_form_data( 'method' ) ?: 'post';
- }
-
- /**
- * Get the fields from the page content.
- *
- * @param string $content
- * @param array $context
- *
- * @return Field[]
- */
- public function get_fields( string $content = '', array $context = [] ): array {
- $all_fields = $this->get_all_fields( $content, $context );
- $input_fields = [];
-
- foreach ( $all_fields as $field ) {
- if ( in_array( $field->get_block_name( true ), FormObject::ALL_INPUT_TYPES ) ) {
- $input_fields[ $field->get_id() ] = $field;
- }
- }
-
- return $input_fields;
- }
-
- /**
- * Get all the fields from the page content.
- *
- * @param string $content
- * @param array $context
- *
- * @return Field[]
- */
- public function get_all_fields( string $content = '', array $context = [] ): array {
- if ( ! empty( $this->fields ) ) {
- return $this->fields;
- }
-
- if ( ! $context ) {
- $context = $this->get_form_context() ?: [ 'postId' => get_the_ID(), 'postType' => get_post_type() ];
- }
-
- if ( ! $content ) {
- $content = $this->get_form_markup() ?: FormObject::get_form_content( $context, $this->get_form_id() );
- }
-
- if ( ! $content ) {
- return [];
- }
-
- $blocks = parse_blocks( $content );
-
- if ( empty( $blocks ) ) {
- return [];
- }
-
- $this->fields = $this->prepare_field_blocks( $blocks, $context );
-
- return $this->fields;
- }
-
- /**
- * Update the field context manually.
- *
- * @return void
- */
- public function update_field_context(): void {
- $fields = $this->get_all_fields();
- $context = [
- 'acffb/formId' => $this->get_id(),
- ];
-
- foreach ( $fields as $field ) {
- $field->set_context( $context );
- }
- }
-
- /**
- * Check if the form has a field of a specific type.
- *
- * @param string $field_type
- * @param string $sub_type
- *
- * @return bool
- */
- public function has_field_type( string $field_type, string $sub_type = '' ): bool {
- $types = $this->get_fields_by_type( $field_type, $sub_type );
-
- return count( $types ) > 0;
- }
-
- /**
- * Get all fields by type
- *
- * @param string $field_type
- * @param string $sub_type
- *
- * @return array
- */
- public function get_fields_by_type( string $field_type, string $sub_type = '' ): array {
- $fields = $this->get_fields();
-
- if ( ! str_starts_with( $field_type, 'acf/' ) ) {
- $field_type = 'acf/' . $field_type;
- }
-
- $types = [];
-
- foreach ( $fields as $field ) {
- if ( $field->get_block_name( true ) === $field_type ) {
- if ( ! $sub_type || $sub_type === $field->get_type() ) {
- $types[ $field->get_id() ] = $field;
- }
- }
- }
-
- return $types;
- }
-
- /**
- * Extract fields from the blocks array.
- *
- * @param array $blocks
- * @param array $context
- *
- * @return array
- */
- private function prepare_field_blocks( array $blocks, array $context ): array {
- $fields = [];
- $filtered = Blocks::get_blocks_by_type( $blocks, FormObject::ALL_FIELD_TYPES );
-
- foreach ( $filtered as $block ) {
- if ( empty( $block['attrs'] ) ) {
- continue;
- }
-
- $attrs = $block['attrs'];
- $attrs['id'] = acf_get_block_id( $attrs, $context );
- $attrs['id'] = acf_ensure_block_id_prefix( $attrs['id'] );
-
- $attrs['wp_block'] = $block;
-
- $block_name = str_replace( '/', '_', $attrs['name'] );
- $prefix = 'acf_form' === $block_name ? $block_name : 'acf_field';
- $block_id = $prefix . '_' . $attrs['blockId'];
-
- $fields[ $block_id ] = Field::factory( $attrs, $attrs );
- }
-
- return $fields;
- }
-
- /**
- * Get the form data.
- *
- * @param string $selector Field selector.
- * @param mixed $default Default value.
- *
- * @return mixed
- */
- public function get_form_data( string $selector, mixed $default = null ): mixed {
- $value = get_field( $selector, $this->get_acf_id() );
-
- if ( ! is_null( $value ) ) {
- return $value;
- }
-
- // Not sure why this is all of sudden necessary.
- if ( isset( $this->block['data'][ $selector ] ) ) {
- return $this->block['data'][ $selector ];
- }
-
- return $default;
- }
-
- /**
- * Get the form metadata.
- *
- * @param string $key Meta key.
- *
- * @return mixed
- */
- public function get_form_meta( string $key ): mixed {
- if ( empty( $this->block['metadata'][ $key ] ) ) {
- return null;
- }
-
- return $this->block['metadata'][ $key ];
- }
-
- /**
- * Get the form template.
- *
- * @return array
- * @throws Exception
- */
- public function get_template(): array {
- return ( new Template() )
- ->add( ( new Block( 'acf/input' ) ) )
- ->add( ( new Block( 'acf/submit', [ 'lock' => [ 'move' => false, 'remove' => true ] ] ) )
- )->get();
- }
-
- /**
- * Get a field by its ID.
- *
- * @param string $field_id
- *
- * @return ?Field
- */
- public function get_field_by_id( string $field_id ): ?Field {
- $fields = $this->get_all_fields();
-
- if ( array_key_exists( $field_id, $fields ) ) {
- return $fields[ $field_id ];
- }
-
- return null;
- }
-
- /**
- * Should we save the form data?
- *
- * @return bool
- */
- public function save_data_enabled(): bool {
- return boolval( $this->get_form_data( 'save_data', true ) );
- }
-
- /**
- * Get the Form ID.
- *
- * @return ?string
- */
- public function get_form_id(): ?string {
- return $this->form_id;
- }
-
- /**
- * Get the pattern ID if any.
- *
- * @return ?int
- */
- public function get_pattern_id(): ?int {
- return $this->pattern_id;
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Input.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Input.php
deleted file mode 100644
index 2896f99d..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Input.php
+++ /dev/null
@@ -1,115 +0,0 @@
-get_field_data( 'default_value' );
-
- if ( ! $default ) {
- return parent::get_default_value();
- }
-
- return $default;
- }
-
- /**
- * Get the field value.
- *
- * @return mixed
- */
- public function get_value_attr(): mixed {
- return parent::get_value();
- }
-
- /**
- * Get the field input type.
- *
- * @return string
- */
- public function get_input_type(): string {
- return $this->get_field_data( 'type', 'text' );
- }
-
- /**
- * Get the max length.
- *
- * @return ?int
- */
- public function get_maxlength(): ?int {
- return $this->get_field_data( 'maxlength' ) ? intval( $this->get_field_data( 'maxlength' ) ) : null;
- }
-
- /**
- * Get the block template.
- *
- * @return array
- * @throws Exception
- */
- public function get_template(): array {
- return ( new Template( new Block( 'acf/label' ) ) )->get();
- }
-
- /**
- * Get attributes for this field.
- *
- * @return array
- */
- public function get_attrs(): array {
- $attrs = parent::get_attrs();
-
- $attrs['data-supports-jsx'] = null;
-
- $attrs['type'] = $this->get_input_type();
- $attrs['value'] = $this->get_value_attr();
-
- if ( is_admin() ) {
- $attrs['readonly'] = 'readonly';
- }
-
- if ( $this->get_maxlength() ) {
- $attrs['maxlength'] = $this->get_maxlength();
-
- if ( $this instanceof Number ) {
- $js_maxlength = 'if(this.value.length>this.maxLength)this.value=this.value.slice(0,this.maxLength)';
- $attrs['oninput'] = $js_maxlength;
- $attrs['onfocus'] = $js_maxlength;
- }
- }
-
- if ( $this instanceof Number ) {
- if ( ! $this->controls_enabled() ) {
- $attrs['data-appearance'] = 'none';
- } else {
- $attrs['step'] = $this->get_step();
-
- if ( $this->get_min() ) {
- $attrs['min'] = $this->get_min();
- }
- if ( $this->get_max() ) {
- $attrs['max'] = $this->get_max();
- }
- }
- }
-
- return $attrs;
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Label.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Label.php
deleted file mode 100644
index 3f4dbf0a..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Label.php
+++ /dev/null
@@ -1,45 +0,0 @@
-get_parent_field();
- if ( $parent && ! is_admin() ) {
- $attrs['for'] = $parent->get_id_attr();
- }
-
- return $attrs;
- }
-
- /**
- * Get the block template.
- *
- * @return array
- */
- public function get_template(): array {
- return ( new Template( ( new Block( 'core/paragraph', [ 'placeholder' => __( 'Field Label...', 'acf-field-blocks' ) ] ) ) ) )->get();
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Legend.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Legend.php
deleted file mode 100644
index 7d7d8b4e..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Legend.php
+++ /dev/null
@@ -1,40 +0,0 @@
- __( 'Legend...', 'acf-field-blocks' ), 'lock' => 'all' ] ) ) ) )->get();
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Number.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Number.php
deleted file mode 100644
index f0ebdef7..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Number.php
+++ /dev/null
@@ -1,50 +0,0 @@
-get_field_data( 'controls' ) );
- }
-
- /**
- * Get the min value
- *
- * @return ?int
- */
- public function get_min(): ?int {
- return $this->get_field_data( 'min' ) ? intval( $this->get_field_data( 'min' ) ) : null;
- }
-
- /**
- * Get the max value
- *
- * @return ?int
- */
- public function get_max(): ?int {
- return $this->get_field_data( 'max' ) ? intval( $this->get_field_data( 'max' ) ) : null;
- }
-
- /**
- * Get the step count
- *
- * @return int
- */
- public function get_step(): int {
- return intval( $this->get_field_data( 'step', 1 ) );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Radios.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Radios.php
deleted file mode 100644
index b060d1f4..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Radios.php
+++ /dev/null
@@ -1,71 +0,0 @@
-get();
- }
-
- /**
- * Get the radio field wrapper attributes.
- *
- * @return array
- */
- public function get_attrs(): array {
- $attrs = parent::get_attrs();
-
- // Discard name since this is on a div element.
- unset( $attrs['name'] );
-
- return $attrs;
- }
-
- /**
- * Render the input value.
- *
- * @param mixed $value Value to render.
- * @param Form $form Form object.
- *
- * @return void
- */
- public function render_value( mixed $value, Form $form ): void {
- $options = $this->get_options();
- if ( ! $value || ! $options ) {
- parent::render_value( null, $form );
- return;
- }
-
- echo '';
- foreach ( $options as $option ) {
- printf(
- '- %s
',
- $option['value'] === $value ? ' class="checked"' : '',
- esc_html( $option['value'] )
- );
- }
- echo '
';
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Select.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Select.php
deleted file mode 100644
index 11456a1b..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Select.php
+++ /dev/null
@@ -1,94 +0,0 @@
-get();
- }
-
- /**
- * If multiple values are allowed.
- *
- * @return bool
- */
- public function is_multiple(): bool {
- return boolval( $this->get_field_data( 'allow_multiple' ) );
- }
-
- /**
- * Get the attributes for the select field.
- *
- * @return array
- */
- public function get_attrs(): array {
- $attrs = parent::get_attrs();
-
- if ( is_admin() ) {
- $attrs['readonly'] = 'readonly';
- }
-
- if ( $this->is_multiple() ) {
- $attrs['multiple'] = 'multiple';
- }
-
- return $attrs;
- }
-
- /**
- * Render the value.
- *
- * @param mixed $value The value.
- * @param Form $form The form object.
- *
- * @return void
- */
- public function render_value( mixed $value, Form $form ): void {
- if ( ! $this->is_multiple() || ! $value ) {
- parent::render_value( $value, $form );
- return;
- }
-
- $values = is_array( $value ) ? $value : [ $value ];
-
- printf(
- '%s
',
- implode( ', ', $values )
- );
- }
-
- /**
- * Get the name attribute.
- *
- * @return string
- */
- public function get_name_attr(): string {
- if ( $this->is_multiple() ) {
- return parent::get_name_attr() . '[]';
- }
-
- return parent::get_name_attr();
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Elements/Textarea.php b/wp-content/plugins/viget-form-blocks/classes/Elements/Textarea.php
deleted file mode 100644
index 7b41f056..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Elements/Textarea.php
+++ /dev/null
@@ -1,53 +0,0 @@
-get();
- }
-
- /**
- * Get the textarea value
- *
- * @return string
- */
- public function get_value(): string {
- $value = parent::get_value() ?: '';
- return str_replace( '\r\n', "\r\n", $value );
- }
-
- /**
- * Get the Textarea Attributes.
- *
- * @return array
- */
- public function get_attrs(): array {
- $attrs = parent::get_attrs();
-
- if ( is_admin() ) {
- $attrs['readonly'] = 'readonly';
- }
-
- return $attrs;
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Form.php b/wp-content/plugins/viget-form-blocks/classes/Form.php
deleted file mode 100644
index 73301af7..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Form.php
+++ /dev/null
@@ -1,652 +0,0 @@
-form = $form;
-
- // Store the fields in cache.
- $this->form->get_all_fields();
-
- if ( $preload_meta ) {
- $this->preload_meta();
- }
-
- if ( $this->initialized ) {
- return;
- }
-
- $this->init_integrations();
-
- $this->initialized = true;
- }
-
- /**
- * Get the Form Instance.
- *
- * @param mixed $form
- * @param string $content
- * @param array $context
- *
- * @return ?self
- */
- public static function get_instance( mixed $form = null, string $content = '', array $context = [] ): ?self {
- $form_id = is_string( $form ) ? self::prefix_id( $form ) : ( ! empty( $form['blockId'] ) ? $form['blockId'] : null );
-
- if ( $form_id ) {
- $cache = Cache::get( $form_id );
-
- if ( $cache ) {
- return $cache;
- }
-
- if ( is_array( $form ) ) {
- $content = self::get_form_content( $context, $form_id );
- $form = new self( new FormElement( $form, $content, $context ), true );
- Cache::set( $form->get_form_object()->get_id(), $form, true );
- return $form;
- }
- }
-
- if ( ! $context ) {
- $post_id = ! empty( $_GET['post'] ) ? intval( $_GET['post'] ) : get_the_ID();
- $post_type = get_post_type( $post_id );
- $context = [ 'postId' => $post_id, 'postType' => $post_type ];
-
- if ( EmailTemplate::POST_TYPE === $post_type ) {
- $template_form_id = get_field( '_vgtfb_form_id', $post_id );
-
- if ( $template_form_id && $form_id !== $template_form_id ) {
- return self::find_form( $template_form_id );
- }
-
- if ( $form_id ) {
- $lookup = self::find_form( $form_id );
- if ( $lookup ) {
- return $lookup;
- }
- }
-
- $context = [];
- }
- }
-
- if ( ! $content ) {
- $content = Form::get_form_content( $context );
- }
-
- if ( ! $content ) {
- return null;
- }
-
- $blocks = parse_blocks( $content );
-
- if ( empty( $blocks ) ) {
- return null;
- }
-
- $form = self::get_form_block( $blocks, $context, $form_id );
-
- if ( ! $form ) {
- return null;
- }
-
- return self::get_instance( $form, $content, $context );
- }
-
- /**
- * Get the Form Block Recursively.
- *
- * @param array $blocks Blocks.
- * @param array $context Context.
- * @param ?string $form_id The targeted form ID.
- *
- * @return ?array
- */
- private static function get_form_block( array $blocks, array $context = [], ?string $form_id = null ): ?array {
- $forms = Blocks::get_blocks_by_type( $blocks, 'acf/form' );
-
- if ( ! $forms ) {
- return null;
- }
-
- if ( 1 === count( $forms ) ) {
- return Blocks::prepare_acf_block( $forms[0], $context );
- }
-
- $form = null;
-
- foreach ( $forms as $block ) {
- $form = Blocks::prepare_acf_block( $block, $context );
-
- // Return the first form if no Form ID.
- if ( ! $form_id ) {
- return $form;
- }
-
- if ( ! empty( $form['blockId'] ) ) {
- $block_form_id = self::prefix_id( $form['blockId'] );
-
- if ( $block_form_id === $form_id ) {
- return $form;
- }
- }
- }
-
- return $form;
- }
-
- /**
- * Extract the form from the post content.
- *
- * @param array $context
- * @param ?string $form_id
- *
- * @return string
- */
- public static function get_form_content( array $context = [], ?string $form_id = null ): string {
- if ( empty( $context['postId'] ) ) {
- $content = get_the_content();
- } else {
- $the_post = get_post( $context['postId'] );
- $content = $the_post?->post_content;
- }
-
- if ( ! $form_id ) {
- return $content ?? '';
- }
-
- $content = self::replace_patterns( $content );
-
- $pattern = '/.*?/s';
- preg_match_all( $pattern, $content, $form_blocks );
-
- if ( empty( $form_blocks[0] ) ) {
- return $content;
- }
-
- foreach ( $form_blocks[0] as $form_block ) {
- $block_id = self::unprefix_id( $form_id );
- if ( preg_match( '//s', $content, $patterns );
-
- if ( ! $patterns ) {
- return $content;
- }
-
- foreach ( $patterns[1] as $pattern_id ) {
- $pattern = Blocks::get_pattern( intval( $pattern_id ), false );
-
- if ( ! $pattern ) {
- continue;
- }
-
- $content = preg_replace( '//', $pattern, $content );
- }
-
- return $content;
- }
-
- /**
- * Ensure Block ID is prefixed.
- *
- * @param string $id
- *
- * @return string
- */
- public static function prefix_id( string $id ): string {
- if ( ! str_starts_with( $id, 'acf_form_' ) ) {
- $id = 'acf_form_' . $id;
- }
-
- return $id;
- }
-
- /**
- * Remove the prefix from the Block ID.
- *
- * @param string $id
- *
- * @return string
- */
- public static function unprefix_id( string $id ): string {
- if ( str_starts_with( $id, 'acf_form_' ) ) {
- $id = str_replace( 'acf_form_', '', $id );
- }
-
- return $id;
- }
-
- /**
- * Get all forms.
- *
- * @return Form[]
- */
- public static function get_all_forms(): array {
- if ( ! empty( self::$all_forms ) ) {
- return self::$all_forms;
- }
-
- $search = new \WP_Query(
- [
- 'post_type' => 'any',
- 'posts_per_page' => -1,
- 'post_status' => 'any',
- 's' => 'acf/form',
- ]
- );
-
- while ( $search->have_posts() ) {
- $search->the_post();
- $content = get_the_content();
-
- if ( ! $content ) {
- continue;
- }
-
- $blocks = parse_blocks( $content );
-
- if ( empty( $blocks ) ) {
- continue;
- }
-
- $context = [ 'postId' => get_the_ID(), 'postType' => get_post_type() ];
- $form_blocks = Blocks::get_blocks_by_type( $blocks, 'acf/form' );
-
- foreach ( $form_blocks as $block ) {
- $form_block = Blocks::prepare_acf_block( $block, $context );
- $form = self::get_instance( $form_block, $content, $context );
-
- if ( ! $form ) {
- continue;
- }
-
- $form->get_form_object()->set_name();
-
- self::$all_forms[] = $form;
- }
- }
-
- wp_reset_postdata();
-
- return self::$all_forms;
- }
-
- /**
- * Find a Form by ID
- *
- * @param ?string $form_id
- *
- * @return ?Form
- */
- public static function find_form( ?string $form_id = null ): ?Form {
- if ( is_null( $form_id ) ) {
- return self::get_instance( $form_id );
- }
-
- foreach ( self::get_all_forms() as $form ) {
- if ( $form_id === $form->get_form_object()->get_id() ) {
- return $form;
- }
- }
-
- return null;
- }
-
- /**
- * Get the form object.
- *
- * @return Elements\Form
- */
- public function get_form_object(): Elements\Form {
- return $this->form;
- }
-
- /**
- * Get the form block element.
- *
- * @return array
- */
- public function get_form_element(): array {
- return $this->form->get_form();
- }
-
- /**
- * Preload the meta data.
- *
- * @return void
- */
- public function preload_meta(): void {
- add_filter(
- 'acf/pre_load_metadata',
- function ( $null, $post_id, $name, $hidden ) {
- $meta = $this->get_field_meta();
- $name = ( $hidden ? '_' : '' ) . $name;
-
- if ( isset( $meta[ $post_id ] ) ) {
- if ( isset( $meta[ $post_id ][ $name ] ) ) {
- return $meta[ $post_id ][ $name ];
- }
- return '__return_null';
- }
-
- return $null;
- },
- 5,
- 4
- );
- }
-
- /**
- * Get the field meta.
- *
- * @return array
- */
- private function get_field_meta(): array {
- $meta = [
- $this->get_form_object()->get_acf_id() => $this->block['data'] ?? [],
- ];
-
- $fields = $this->form->get_fields();
- foreach ( $fields as $field ) {
- $field_block = $field->get_block();
- if ( empty( $field_block['data'] ) ) {
- continue;
- }
-
- foreach ( $field_block['data'] as $key => $value ) {
- $meta[ $field->get_name() ][ $key ] = $value;
- }
- }
-
- return $meta;
- }
-
- /**
- * Update the cache.
- *
- * @return void
- */
- public function update_cache(): void {
- Cache::set( $this->get_form_object()->get_id(), $this );
- }
-
- /**
- * Get the form confirmation.
- *
- * @return Confirmation
- */
- public function get_confirmation(): Confirmation {
- if ( null === $this->confirmation ) {
- $this->confirmation = new Confirmation( $this );
- }
-
- return $this->confirmation;
- }
-
- /**
- * Get the form submission.
- *
- * @return Submission
- */
- public function get_submission(): Submission {
- if ( null === $this->submission ) {
- $this->submission = new Submission( $this );
- }
-
- return $this->submission;
- }
-
- /**
- * Get the form validation.
- *
- * @return Validation
- */
- public function get_validation(): Validation {
- if ( null === $this->validation ) {
- $this->validation = new Validation( $this );
- }
-
- return $this->validation;
- }
-
- /**
- * Get the form notification.
- *
- * @return Notification
- */
- public function get_notification(): Notification {
- if ( null === $this->notification ) {
- $this->notification = new Notification( $this );
- }
-
- return $this->notification;
- }
-
- /**
- * Init the form integrations.
- *
- * @return void
- */
- public function init_integrations(): void {
- Integration::get_integrations( $this->get_form_object()->get_form_id() );
- }
-
- /**
- * Get the form meta.
- *
- * @return Meta[]
- */
- public function get_meta(): array {
- if ( empty( $this->registered_meta ) ) {
- $this->register_meta();
- }
-
- return $this->registered_meta;
- }
-
- /**
- * Load meta from Post meta.
- *
- * @param int $post_id
- *
- * @return void
- */
- public function load_meta( int $post_id ): void {
- foreach ( $this->get_meta() as $meta_field ) {
- // Set value no matter what when loading so we don't end up with default values.
- $meta_value = get_post_meta( $post_id, $meta_field->get_key(), true );
- $meta_field->set_value( $meta_value );
- }
- }
-
- /**
- * Register the Form Meta
- *
- * @return void
- */
- public function register_meta(): void {
- $meta_classes = [
- URL::class,
- IP::class,
- UserAgent::class,
- RequestMethod::class,
- PostID::class,
- FormMeta::class,
- ConfirmationMeta::class,
- Notifications::class,
- ];
-
- $meta_classes = apply_filters( 'vgtfb_meta_classes', $meta_classes );
-
- foreach ( $meta_classes as $meta_class ) {
- if ( ! class_exists( $meta_class ) ) {
- return;
- }
-
- $meta = new $meta_class( $this->form->get_id() );
- $this->registered_meta[ $meta->get_key() ] = $meta;
- }
- }
-
- /**
- * Get a meta field
- *
- * @param string $key
- *
- * @return ?Meta
- */
- public function get_meta_field( string $key ): ?Meta {
- $meta = $this->get_meta();
- if ( empty( $meta[ $key ] ) ) {
- return null;
- }
-
- return $meta[ $key ];
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Integrations/Integration.php b/wp-content/plugins/viget-form-blocks/classes/Integrations/Integration.php
deleted file mode 100644
index 4c740264..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Integrations/Integration.php
+++ /dev/null
@@ -1,120 +0,0 @@
-id = $integration_id;
-
- $this->init();
- }
-
- /**
- * Init
- *
- * @return void
- */
- public function init(): void {
- $this->form_id = get_field( '_vgtfb_form_id', $this->id );
- $this->form = Form::find_form( $this->form_id );
-
- add_action(
- 'vgtfb_handle_validation',
- [ $this, 'validate' ]
- );
-
- add_action(
- 'vgtfb_process_submission',
- [ $this, 'process' ]
- );
- }
-
- /**
- * Run Validation
- *
- * @return bool
- */
- public function validate(): bool {
- return true;
- }
-
- /**
- * Process the Integration
- *
- * @param Submission $submission
- *
- * @return void
- */
- public function process( Submission $submission ): void {
- $this->submission = $submission;
- $this->form = $submission->form;
- }
-
- /**
- * Perform Test
- *
- * @return array|WP_Error
- */
- public function test(): array|WP_Error {
- return [
- 'response' => [
- 'code' => 200,
- 'message' => 'OK',
- 'form_id' => $this->form_id
- ],
- ];
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Integrations/Request.php b/wp-content/plugins/viget-form-blocks/classes/Integrations/Request.php
deleted file mode 100644
index 7fcfe1d6..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Integrations/Request.php
+++ /dev/null
@@ -1,178 +0,0 @@
-id );
- $headers = get_field( 'headers', $this->id );
- $mapping = get_field( 'mapping', $this->id );
-
- $this->config = apply_filters(
- 'vgtfb_integration_request_config',
- [
- 'url' => $settings['url'] ?: '',
- 'method' => $settings['method'] ?: 'POST',
- 'format' => $settings['format'] ?: 'json',
- 'headers' => $headers ?: [],
- 'mapping' => $mapping ?: [],
- ]
- );
-
- $this->url = $this->config['url'];
- $this->method = $this->config['method'];
- $this->format = $this->config['format'];
-
- $this->headers = $this->config['headers'];
- $this->mapping = $this->config['mapping'];
-
- if ( 'json' === $this->format ) {
- $this->headers['Content-Type'] = 'application/json';
- }
- }
-
- /**
- * Process the request
- *
- * @param Submission $submission
- *
- * @throws \Exception
- *
- * @return void
- */
- public function process( Submission $submission ): void {
- parent::process( $submission );
-
- if ( ! $this->url ) {
- throw new \Exception( 'Request URL is required.' );
- }
-
- if ( empty( $this->mapping ) ) {
- foreach ( $this->submission->get_data()['content'] as $key => $value ) {
- $this->body[ $key ] = $value;
- }
- } else {
- foreach ( $this->mapping as $map ) {
- $value = $this->submission->get_field_data( $map['field'] );
- $this->body[ $map['key'] ] = $value;
- }
- }
-
- $response = $this->send();
-
- $submission->add_meta(
- 'request_response',
- [
- 'body' => wp_remote_retrieve_body( $response ),
- 'headers' => wp_remote_retrieve_headers( $response ),
- 'code' => wp_remote_retrieve_response_code( $response ),
- ]
- );
- }
-
- /**
- * Send the request
- *
- * @return array|WP_Error
- */
- private function send(): array|WP_Error {
- $request_args = apply_filters(
- 'vgtfb_integration_request_args',
- [
- 'method' => $this->method,
- 'headers' => $this->headers,
- 'body' => $this->format_request_body(),
- ],
- $this
- );
-
- return wp_remote_request( $this->url, $request_args );
- }
-
- /**
- * Perform Test
- *
- * @return array|WP_Error
- */
- public function test(): array|WP_Error {
- foreach ( $this->form->get_form_object()->get_fields() as $field ) {
- $this->body[ $field->get_name() ] = $field->get_dummy_value();
- }
-
- return $this->send();
- }
-
- /**
- * Format the request body
- *
- * @return string
- */
- private function format_request_body(): string {
- if ( 'json' === $this->format ) {
- return json_encode( $this->body );
- }
-
- return http_build_query( $this->body );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Meta/Confirmation.php b/wp-content/plugins/viget-form-blocks/classes/Meta/Confirmation.php
deleted file mode 100644
index cec08095..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Meta/Confirmation.php
+++ /dev/null
@@ -1,62 +0,0 @@
-key = '_confirmation';
- $this->type = 'array';
- $this->label = __( 'Confirmation', 'viget-form-blocks' );
-
- $this->children = [
- 'type' => [
- 'type' => 'string',
- 'label' => __( 'Confirmation Type', 'viget-form-blocks' ),
- ],
- 'page' => [
- 'type' => 'post_id',
- 'label' => __( 'Confirmation Page', 'viget-form-blocks' ),
- ],
- 'url' => [
- 'type' => 'string',
- 'label' => __( 'Redirect URL', 'viget-form-blocks' ),
- ],
- ];
- }
-
- /**
- * Set Meta Value
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_value( mixed $value = null ): void {
- if ( ! is_null( $value ) ) {
- parent::set_value( $value );
- return;
- }
-
- $this->value = [
- 'type' => $this->get_form()->get_confirmation()->get_type(),
- 'page' => $this->get_form()->get_form_object()->get_form_data( 'page' ),
- 'url' => $this->get_form()->get_form_object()->get_form_data( 'custom_url' ),
- ];
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Meta/Form.php b/wp-content/plugins/viget-form-blocks/classes/Meta/Form.php
deleted file mode 100644
index 0e23c629..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Meta/Form.php
+++ /dev/null
@@ -1,67 +0,0 @@
-key = '_form';
- $this->type = 'array';
- $this->label = __( 'Form', 'viget-form-blocks' );
-
- $this->children = [
- 'id' => [
- 'type' => 'string',
- 'label' => __( 'Form ID', 'viget-form-blocks' ),
- ],
- 'name' => [
- 'type' => 'string',
- 'label' => __( 'Form Name', 'viget-form-blocks' ),
- ],
- 'markup' => [
- 'type' => 'string',
- 'label' => __( 'Form Markup', 'viget-form-blocks' ),
- ],
- 'context' => [
- 'type' => 'array',
- 'label' => __( 'Form Context', 'viget-form-blocks' ),
- ],
- ];
- }
-
- /**
- * Set Meta Value
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_value( mixed $value = null ): void {
- if ( ! is_null( $value ) ) {
- parent::set_value( $value );
- return;
- }
-
- $this->value = [
- 'id' => $this->get_form()->get_form_object()->get_id(),
- 'name' => $this->get_form()->get_form_object()->get_name(),
- 'markup' => $this->get_form()->get_form_object()->get_form_markup(),
- 'context' => $this->get_form()->get_form_object()->get_form_context(),
- ];
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Meta/IP.php b/wp-content/plugins/viget-form-blocks/classes/Meta/IP.php
deleted file mode 100644
index 5653b571..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Meta/IP.php
+++ /dev/null
@@ -1,53 +0,0 @@
-key = '_ip';
- $this->label = __( 'IP Address', 'viget-form-blocks' );
- }
-
- /**
- * Set Meta Value
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_value( mixed $value = null ): void {
- if ( ! is_null( $value ) ) {
- parent::set_value( $value );
- return;
- }
-
- $this->value = $_SERVER['REMOTE_ADDR'] ?? '';
- }
-
- /**
- * Sanitize the value
- *
- * @param mixed $value
- *
- * @return string
- */
- public function sanitize( mixed $value ): string {
- return sanitize_text_field( $value );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Meta/Meta.php b/wp-content/plugins/viget-form-blocks/classes/Meta/Meta.php
deleted file mode 100644
index 92a97559..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Meta/Meta.php
+++ /dev/null
@@ -1,226 +0,0 @@
-form_id = $form_id;
- }
- }
-
- /**
- * Get the form.
- *
- * @return ?Form
- */
- public function get_form(): ?Form {
- if ( ! $this->form_id ) {
- return null;
- }
-
- return Form::find_form( $this->form_id );
- }
-
- /**
- * Get Meta Key
- *
- * @return string
- */
- public function get_key(): string {
- return $this->key;
- }
-
- /**
- * Get Meta Label
- *
- * @param ?string $child
- *
- * @return string
- */
- public function get_label( ?string $child = null ): string {
- if ( ! is_null( $child ) ) {
- return $this->children[ $child ]['label'] ?? 'Undefined';
- }
-
- return $this->label;
- }
-
- /**
- * Set Meta Value
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_value( mixed $value = null ): void {
- $this->value = $value;
- }
-
- /**
- * Get Meta Value
- *
- * @param ?string $child
- *
- * @return mixed
- */
- public function get_value( ?string $child = null, bool $for_display = false ): mixed {
- if ( is_null( $this->value ) ) {
- $this->set_value(); // Init the built-in value.
- }
-
- if ( $for_display ) {
- $this->set_display_values();
- }
-
- if ( ! is_null( $child ) && is_array( $this->value ) ) {
- return $this->value[ $child ] ?? null;
- }
-
- return $this->value;
- }
-
- /**
- * Convert boolean values to be readable
- *
- * @return void
- */
- protected function set_display_values(): void {
- if ( is_array( $this->value ) ) {
- foreach ( $this->value as $key => &$value ) {
- $value = $this->get_display_value( $this->get_type( $key ), $value );
- }
- } else {
- $this->value = $this->get_display_value( $this->get_type(), $this->value );
- }
- }
-
- /**
- * Get Display Value based on type
- *
- * @param string $type
- * @param mixed $value
- *
- * @return mixed
- */
- private function get_display_value( string $type, mixed $value ): mixed {
- if ( 'bool' === $type ) {
- return $value ? __( 'Yes', 'viget-form-blocks' ) : __( 'No', 'viget-form-blocks' );
- }
-
- if ( 'post_id' === $type && false !== get_post_status( $value ) ) {
- return sprintf(
- '%s (%s)',
- get_edit_post_link( $value ),
- get_the_title( $value ),
- esc_html( $value )
- );
- }
-
- return $value;
- }
-
- /**
- * Get the Meta value type.
- *
- * @param ?string $child
- *
- * @return string
- */
- public function get_type( ?string $child = null ): string {
- if ( ! is_null( $child ) && 'array' === $this->type ) {
- return $this->children[ $child ]['type'] ?? 'string';
- }
-
- return $this->type;
- }
-
- /**
- * Check if meta value is a specific type
- *
- * @param string $type
- *
- * @return bool
- */
- private function is_type( string $type ): bool {
- return $type === $this->type;
- }
-
- /**
- * Get Sanitized Value
- *
- * @return mixed
- */
- public function get_sanitized_value(): mixed {
- return $this->sanitize( $this->get_value() );
- }
-
- /**
- * Sanitize the Value
- *
- * @param mixed $value
- *
- * @return mixed
- */
- public function sanitize( mixed $value ): mixed {
- return $value;
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Meta/Notifications.php b/wp-content/plugins/viget-form-blocks/classes/Meta/Notifications.php
deleted file mode 100644
index 809b2951..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Meta/Notifications.php
+++ /dev/null
@@ -1,82 +0,0 @@
-key = '_notifications';
- $this->type = 'array';
- $this->label = __( 'Notifications', 'viget-form-blocks' );
-
- $this->children = [
- 'admin' => [
- 'type' => 'bool',
- 'label' => __( 'Admin Notification', 'viget-form-blocks' ),
- ],
- 'admin_template' => [
- 'type' => 'post_id',
- 'label' => __( 'Admin Template', 'viget-form-blocks' ),
- ],
- 'confirmation' => [
- 'type' => 'bool',
- 'label' => __( 'Confirmation Notification', 'viget-form-blocks' ),
- ],
- 'confirmation_template' => [
- 'type' => 'post_id',
- 'label' => __( 'Confirmation Template', 'viget-form-blocks' ),
- ],
- 'custom' => [
- 'type' => 'bool',
- 'label' => __( 'Custom Notification', 'viget-form-blocks' ),
- ],
- 'recipient' => [
- 'type' => 'string',
- 'label' => __( 'Custom Email Recipient', 'viget-form-blocks' ),
- ],
- 'custom_template' => [
- 'type' => 'post_id',
- 'label' => __( 'Custom Template', 'viget-form-blocks' ),
- ],
- ];
- }
-
- /**
- * Set Meta Value
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_value( mixed $value = null ): void {
- if ( ! is_null( $value ) ) {
- parent::set_value( $value );
- return;
- }
-
- $this->value = [
- 'admin' => $this->get_form()->get_notification()->is_admin_email_enabled(),
- 'admin_template' => $this->get_form()->get_notification()->get_admin_template(),
- 'confirmation' => $this->get_form()->get_notification()->is_confirmation_email_enabled(),
- 'confirmation_template' => $this->get_form()->get_notification()->get_confirmation_template(),
- 'custom' => $this->get_form()->get_notification()->is_custom_email_enabled(),
- 'recipient' => $this->get_form()->get_notification()->get_custom_email(),
- 'custom_template' => $this->get_form()->get_notification()->get_custom_template(),
- ];
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Meta/PostID.php b/wp-content/plugins/viget-form-blocks/classes/Meta/PostID.php
deleted file mode 100644
index aa19760b..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Meta/PostID.php
+++ /dev/null
@@ -1,54 +0,0 @@
-key = '_post_id';
- $this->type = 'post_id';
- $this->label = __( 'Post ID', 'viget-form-blocks' );
- }
-
- /**
- * Set Meta Value
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_value( mixed $value = null ): void {
- if ( ! is_null( $value ) ) {
- parent::set_value( $value );
- return;
- }
-
- $this->value = get_queried_object_id();
- }
-
- /**
- * Sanitize the value
- *
- * @param mixed $value
- *
- * @return string
- */
- public function sanitize( mixed $value ): string {
- return sanitize_text_field( $value );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Meta/RequestMethod.php b/wp-content/plugins/viget-form-blocks/classes/Meta/RequestMethod.php
deleted file mode 100644
index 6c8dc9da..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Meta/RequestMethod.php
+++ /dev/null
@@ -1,55 +0,0 @@
-key = '_method';
- $this->label = __( 'Request Method', 'viget-form-blocks' );
- }
-
- /**
- * Set Meta Value
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_value( mixed $value = null ): void {
- if ( ! is_null( $value ) ) {
- parent::set_value( $value );
- return;
- }
-
- $this->value = $_SERVER['REQUEST_METHOD'] ?? '';
- }
-
- /**
- * Sanitize the value
- *
- * @param mixed $value
- *
- * @return string
- */
- public function sanitize( mixed $value ): string {
- return sanitize_text_field( $value );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Meta/URL.php b/wp-content/plugins/viget-form-blocks/classes/Meta/URL.php
deleted file mode 100644
index 32aa7d0d..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Meta/URL.php
+++ /dev/null
@@ -1,53 +0,0 @@
-key = '_url';
- $this->label = __( 'Source URL', 'viget-form-blocks' );
- }
-
- /**
- * Set Meta Value
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_value( mixed $value = null ): void {
- if ( ! is_null( $value ) ) {
- parent::set_value( $value );
- return;
- }
-
- $this->value = $_SERVER['REQUEST_URI'] ?? '';
- }
-
- /**
- * Sanitize the value
- *
- * @param mixed $value
- *
- * @return string
- */
- public function sanitize( mixed $value ): string {
- return esc_url( $value );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Meta/UserAgent.php b/wp-content/plugins/viget-form-blocks/classes/Meta/UserAgent.php
deleted file mode 100644
index f2e09fa1..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Meta/UserAgent.php
+++ /dev/null
@@ -1,53 +0,0 @@
-key = '_agent';
- $this->label = __( 'User Agent', 'viget-form-blocks' );
- }
-
- /**
- * Set Meta Value
- *
- * @param mixed $value
- *
- * @return void
- */
- public function set_value( mixed $value = null ): void {
- if ( ! is_null( $value ) ) {
- parent::set_value( $value );
- return;
- }
-
- $this->value = $_SERVER['HTTP_USER_AGENT'] ?? '';
- }
-
- /**
- * Sanitize the value
- *
- * @param mixed $value
- *
- * @return string
- */
- public function sanitize( mixed $value ): string {
- return sanitize_text_field( $value );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Notification.php b/wp-content/plugins/viget-form-blocks/classes/Notification.php
deleted file mode 100644
index 514e7778..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Notification.php
+++ /dev/null
@@ -1,313 +0,0 @@
-form_id = $form->get_form_object()->get_id();
-
- // Add the hooks.
- $this->add_hooks();
- }
-
- private function add_hooks(): void {
- // Process notifications on form submission.
- add_action( 'vgtfb_process_submission', [ $this, 'process' ], 10 );
- }
-
- /**
- * Get the form instance.
- *
- * @return ?Form
- */
- public function get_form(): ?Form {
- return Form::find_form( $this->form_id );
- }
-
- /**
- * Process the notification emails
- *
- * @return void
- */
- public function process(): void {
- if ( $this->is_admin_email_enabled() ) {
- $this->send_admin_email();
- }
-
- if ( $this->is_confirmation_email_enabled() ) {
- $this->send_confirmation_email();
- }
-
- if ( $this->is_custom_email_enabled() ) {
- $this->send_custom_email();
- }
- }
-
- /**
- * Send the Admin Email
- *
- * @return void
- */
- private function send_admin_email(): void {
- $form = $this->get_form();
- $submission_url = $form->get_submission()->get_submission_url();
-
- $form_name = $form->get_form_object()->get_name();
- $recipient = get_option( 'admin_email' );
- $subject = __( 'New Form Submission', 'viget-form-blocks' ) . ': ' . $form_name;
- $body = __( 'A new form submission has been received for the form', 'viget-form-blocks' ) . ': ' . $form_name . '
';
- $body .= wp_json_encode( $form->get_submission()->get_data(), JSON_PRETTY_PRINT );
-
- if ( $submission_url ) {
- $body .= '
';
- $body .= sprintf(
- '%s',
- esc_url( $submission_url ),
- __( 'Click here to view the submission details.', 'viget-form-blocks' )
- );
- }
-
- $template_id = $this->get_admin_template();
-
- if ( $template_id ) {
- $template = get_post( $template_id );
- $subject = get_field( 'email_subject', $template_id ) ?: $subject;
- $body = apply_filters( 'the_content', $template->post_content ) ?: $body;
- }
-
- $this->send_email( $recipient, $subject, $body );
- }
-
- /**
- * Send the Confirmation Email
- *
- * @return void
- */
- private function send_confirmation_email(): void {
- $recipient = $this->get_confirmation_recipient();
-
- if ( ! $recipient ) {
- return;
- }
-
- $form = $this->get_form();
- $form_name = $form->get_form_object()->get_name();
- $subject = __( 'Form Submission Confirmation', 'viget-form-blocks' );
- $body = __( 'This is a confirmation that your submission has been received for the form', 'viget-form-blocks' ) . ': ' . $form_name . '
';
- $body .= wp_json_encode( $form->get_submission()->get_data(), JSON_PRETTY_PRINT );
-
- $template_id = $this->get_confirmation_template();
-
- if ( $template_id ) {
- $template = get_post( $template_id );
- $subject = get_field( 'email_subject', $template_id ) ?: $subject;
- $body = apply_filters( 'the_content', $template->post_content ) ?: $body;
- }
-
- $this->send_email( $recipient, $subject, $body );
- }
-
- /**
- * Get the Confirmation Email address
- *
- * @return string
- */
- private function get_confirmation_recipient(): string {
- $emails = $this->get_form()->get_form_object()->get_fields_by_type( 'input', 'email' );
-
- if ( ! $emails ) {
- return '';
- }
-
- $recipients = '';
-
- foreach ( $emails as $email ) {
- $recipient = $email->get_value_attr();
- if ( $recipient ) {
- $recipients .= $recipients ? ',' . $recipient : $recipient;
- }
- }
-
- return $recipients;
- }
-
- /**
- * Send the Custom Email
- *
- * @return void
- */
- private function send_custom_email(): void {
- $form = $this->get_form();
- $form_name = $form->get_form_object()->get_name();
- $recipient = $this->get_custom_email();
- $subject = __( 'New Form Submission', 'viget-form-blocks' ) . ': ' . $form_name;
- $body = __( 'A new form submission has been received for the form', 'viget-form-blocks' ) . ': ' . $form_name . '
';
- $body .= wp_json_encode( $form->get_submission()->get_data(), JSON_PRETTY_PRINT );
-
- $template_id = $this->get_custom_template();
-
- if ( $template_id ) {
- $template = get_post( $template_id );
- $subject = get_field( 'email_subject', $template_id ) ?: $subject;
- $body = apply_filters( 'the_content', $template->post_content ) ?: $body;
- }
-
- $this->send_email( $recipient, $subject, $body );
- }
-
- /**
- * Wrap Email body in Header and Footer.
- *
- * @param string $body
- *
- * @return string
- */
- private function wrap_body( string $body ): string {
- $header = Views::get( 'parts/email-header' );
- $footer = Views::get( 'parts/email-footer' );
-
- return $header . $body . $footer;
- }
-
- /**
- * Check if Admin Email Notification is enabled.
- *
- * @return bool
- */
- public function is_admin_email_enabled(): bool {
- return boolval( $this->get_form()->get_form_object()->get_form_data( 'admin_email' ) );
- }
-
- /**
- * Check if Confirmation Email Notification is enabled.
- *
- * @return bool
- */
- public function is_confirmation_email_enabled(): bool {
- return boolval( $this->get_form()->get_form_object()->get_form_data( 'confirmation_email' ) );
- }
-
- /**
- * Check if Custom Email Notification is enabled.
- *
- * @return bool
- */
- public function is_custom_email_enabled(): bool {
- return boolval( $this->get_form()->get_form_object()->get_form_data( 'custom_email' ) );
- }
-
- /**
- * Get the Custom Email address.
- *
- * @return string
- */
- public function get_custom_email(): string {
- return (string) $this->get_form()->get_form_object()->get_form_data( 'email_recipient' );
- }
-
- /**
- * Get the Admin Email Template
- *
- * @return int
- */
- public function get_admin_template(): int {
- return $this->get_template( 'admin_template' );
- }
-
- /**
- * Get the Confirmation Email Template
- *
- * @return int
- */
- public function get_confirmation_template(): int {
- return $this->get_template( 'confirmation_template' );
- }
-
- /**
- * Get the Custom Email Template
- *
- * @return int
- */
- public function get_custom_template(): int {
- return $this->get_template( 'custom_template' );
- }
-
- /**
- * Get an Email Template form setting.
- *
- * @param string $key
- *
- * @return int
- */
- private function get_template( string $key ): int {
- $template = intval( $this->get_form()->get_form_object()->get_form_data( $key ) );
-
- if ( ! $template ) {
- return EmailTemplate::get_default_template();
- }
-
- return $template;
- }
-
- /**
- * Send an email.
- *
- * @param string $recipient
- * @param string $subject
- * @param string $body
- * @param array $headers
- * @param array $attachments
- *
- * @return mixed
- */
- public function send_email( string $recipient, string $subject, string $body, array $headers = [], array $attachments = [] ): mixed {
- add_filter(
- 'wp_mail_content_type',
- function ( string $content_type ): string {
- return 'text/html';
- }
- );
-
- add_action(
- 'vgtfb_email_head',
- function () {
- $admin_css_path = VGTFB_PLUGIN_PATH . 'assets/css/admin.css';
- printf(
- '',
- file_get_contents( $admin_css_path )
- );
- }
- );
-
- return wp_mail(
- $recipient,
- $subject,
- $this->wrap_body( $body ),
- $headers,
- $attachments
- );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Submission.php b/wp-content/plugins/viget-form-blocks/classes/Submission.php
deleted file mode 100644
index 06305653..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Submission.php
+++ /dev/null
@@ -1,312 +0,0 @@
-form = $form;
-
- // Disable caching.
- $this->submission_nocache_headers();
-
- // Save the form data
- $this->save_submission();
- }
-
- /**
- * Check if the form has been submitted.
- *
- * @return bool
- */
- public function has_submit(): bool {
- if ( ! $this->nonce_verified ) {
- $nonce_field = Form::HIDDEN_FORM_ID . '_' .$this->form->get_form_object()->get_id() . '_nonce';
-
- if ( empty( $_REQUEST[ $nonce_field ] ) || ! wp_verify_nonce( $_REQUEST[ $nonce_field ], 'form_submission' ) ) {
- return false;
- }
-
- $this->nonce_verified = true;
- $this->form->update_cache();
- }
-
- return ! empty( $_REQUEST[ Form::HIDDEN_FORM_ID ] ) && $this->form->get_form_object()->get_id() === $_REQUEST[ Form::HIDDEN_FORM_ID ];
- }
-
- /**
- * Check if the form submission was successful.
- *
- * @return bool
- */
- public function is_processed(): bool {
- return $this->is_processed;
- }
-
- /**
- * Prepare for submission.
- *
- * @return void
- */
- private function prepare_submission(): void {
- // Disable caching.
- $this->set_nocache_headers();
-
- // Start Session
- $this->start_session();
- }
-
- /**
- * Start the session.
- *
- * @return void
- */
- private function start_session(): void {
- if ( headers_sent() ) {
- return;
- }
-
- if ( ! session_id() ) {
- session_start();
- }
- }
-
- /**
- * Process the form submission.
- *
- * @return void
- */
- public function process(): void {
- $this->prepare_submission();
-
- if ( $this->is_processed() ) {
- return;
- }
-
- if ( ! $this->has_submit() ) {
- return;
- }
-
- if ( $this->form->get_validation()->has_errors() ) {
- return;
- }
-
- $this->is_processed = true;
- $this->form->get_notification();
- $this->form->get_confirmation();
- $this->form->update_cache();
-
- do_action( 'vgtfb_process_submission', $this );
- }
-
- /**
- * Hook during the submission to no cache headers.
- *
- * @return void
- */
- public function submission_nocache_headers(): void {
- add_action(
- 'vgtfb_process_submission',
- function () {
- $this->set_nocache_headers();
- },
- 2
- );
- }
-
- /**
- * Set the no cache headers.
- *
- * @return void
- */
- private function set_nocache_headers(): void {
- if ( headers_sent() ) {
- return;
- }
-
- header( 'Cache-Control: no-cache, no-store, must-revalidate, max-age=0' );
- header( 'Cache-Control: post-check=0, pre-check=0', false );
- header( 'Pragma: no-cache' );
- }
-
- /**
- * Get the field data.
- *
- * @param string $field_name The Field Name.
- *
- * @return mixed
- */
- public function get_field_data( string $field_name ): mixed {
- $data = $this->get_data();
- return $data['content'][ $field_name ]['value'] ?? null;
- }
-
- /**
- * Get the form data.
- *
- * @return array
- */
- public function get_data(): array {
- if ( ! empty( $this->data ) ) {
- return $this->data;
- }
-
- $fields = $this->form->get_form_object()->get_fields();
- $meta_fields = $this->form->get_meta();
- $this->data = [
- 'content' => [],
- 'meta' => [],
- ];
-
- foreach ( $fields as $field ) {
- if ( ! method_exists( $field, 'get_child_fields' ) ) {
- continue;
- }
-
- $children = $field->get_child_fields( $this->form );
-
- foreach ( $children as $child ) {
- if ( array_key_exists( $child->get_id(), $fields ) ) {
- unset( $fields[ $child->get_id() ] );
- }
- }
- }
-
- foreach ( $fields as $field ) {
- $data = [
- 'label' => $field->get_field_label(),
- 'value' => $field->sanitize_input( null, $this->form ),
- ];
-
- $this->data['content'][ $field->get_name() ] = $data;
- }
-
- foreach ( $meta_fields as $meta_field ) {
- $this->data['meta'][ $meta_field->get_key() ] = $meta_field->get_value();
- }
-
- $this->data = apply_filters( 'vgtfb_submission_data', $this->data );
-
- $this->form->update_cache();
-
- return $this->data;
- }
-
- /**
- * Add meta data to the form submission.
- *
- * @param string $key The key.
- * @param mixed $value The value.
- *
- * @return void
- */
- public function add_meta( string $key, mixed $value ): void {
- $this->data['meta'][ $key ] = $value;
- }
-
- /**
- * Save the form data.
- *
- * @return void
- */
- public function save_submission(): void {
- add_action(
- 'vgtfb_process_submission',
- function () {
- if ( ! $this->form->get_form_object()->save_data_enabled() ) {
- return;
- }
-
- $form_name = $this->form->get_form_object()->get_name();
- $form_data = $this->get_data();
- $submission_key = md5( serialize( $form_data['content'] ) );
- $form_post = apply_filters(
- 'vgtfb_submission_post',
- [
- 'post_type' => Admin\Submission::POST_TYPE,
- 'post_title' => $form_name . ' ' . __( 'Submission', 'viget-form-blocks' ),
- 'post_status' => 'publish',
- 'post_name' => sanitize_title( $form_name . ' ' . $submission_key ),
- 'post_content' => wp_json_encode( $form_data['content'] ),
- ]
- );
-
- $submission_id = wp_insert_post( $form_post );
-
- if ( ! $submission_id ) {
- return;
- }
-
- $this->submission_id = $submission_id;
-
- foreach ( $form_data['meta'] as $meta_key => $meta_value ) {
- update_post_meta( $submission_id, $meta_key, $meta_value );
- }
-
- $this->form->update_cache();
- },
- 5
- );
- }
-
- /**
- * Get the submission admin URL.
- *
- * @return ?string
- */
- public function get_submission_url(): ?string {
- if ( ! $this->submission_id ) {
- return null;
- }
-
- return get_edit_post_link( $this->submission_id );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Traits/AdminPostType.php b/wp-content/plugins/viget-form-blocks/classes/Traits/AdminPostType.php
deleted file mode 100644
index c9b1229c..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Traits/AdminPostType.php
+++ /dev/null
@@ -1,206 +0,0 @@
-get_forms_list();
-
- if ( count( $forms ) <= 1 ) {
- return;
- }
-
- $selected = ! empty( $_GET['vgtfb_form_id'] ) ? $_GET['vgtfb_form_id'] : false;
-
- printf(
- '';
- }
- );
-
- $this->apply_admin_filters();
- }
-
- /**
- * Apply admin filters
- *
- * @return void
- */
- private function apply_admin_filters(): void {
- add_action( 'pre_get_posts', [ $this, 'filter_by_form' ] );
- }
-
- /**
- * Disable admin filters
- *
- * @return void
- */
- private function disable_admin_filters(): void {
- remove_action( 'pre_get_posts', [ $this, 'filter_by_form' ] );
- }
-
- /**
- * Filter Results by Form ID.
- *
- * @param WP_Query $query
- *
- * @return void
- */
- public function filter_by_form( WP_Query $query ): void {
- global $pagenow;
-
- if ( ! is_admin() || self::POST_TYPE !== $query->query['post_type'] || 'edit.php' !== $pagenow || empty( $_GET['vgtfb_form_id'] ) || ! $query->is_main_query() ) {
- return;
- }
-
- $form_id = sanitize_text_field( $_GET['vgtfb_form_id'] );
- $post_status = ! empty( $_GET['post_status'] ) ? sanitize_text_field( $_GET['post_status'] ) : 'publish';
-
- $query->set( 'post_status', $post_status );
- $query->set( 'meta_value', $form_id );
-
- if ( Submission::POST_TYPE === self::POST_TYPE ) {
- $query->set( 'meta_key', '_form' );
- $query->set( 'meta_compare', 'LIKE' );
- } else {
- $query->set( 'meta_key', $this->form_meta_key );
- }
- }
-
- /**
- * Get the forms
- *
- * @return Form[]
- */
- private function get_forms(): array {
- return Form::get_all_forms();
- }
-
- /**
- * Get the forms list
- *
- * @return string[]
- */
- private function get_forms_list(): array {
- $all_forms = $this->get_forms();
- $forms = [];
-
- if ( ! $all_forms ) {
- return $forms;
- }
-
- foreach ( $all_forms as $form ) {
- $forms[ $form->get_form_object()->get_id() ] = $form->get_form_object()->get_unique_name();
- }
-
- return $forms;
- }
-
- /**
- * Populate the Forms select field with available forms.
- *
- * @return void
- */
- private function populate_forms_select(): void {
- add_filter(
- 'acf/prepare_field/name=_vgtfb_form_id',
- function ( array $field ): array {
- $forms = $this->get_forms();
-
- if ( ! $forms ) {
- return $field;
- }
-
- foreach ( $forms as $form ) {
- $field['choices'][ $form->get_form_object()->get_id() ] = $form->get_form_object()->get_unique_name();
- }
-
- return $field;
- }
- );
- }
-
- /**
- * Display the form name in the admin columns.
- *
- * @return void
- */
- private function form_admin_column(): void {
- add_action(
- 'manage_' . self::POST_TYPE . '_posts_custom_column',
- function( $column_name, $post_id ) {
- if ( '_vgtfb_form_id' === $column_name ) {
- $form_id = get_post_meta( $post_id, '_vgtfb_form_id', true );
- if ( ! $form_id ) {
- printf( '%s',
- esc_html__( 'Any Form', 'viget-form-blocks' )
- );
- return;
- }
-
- $form = Form::find_form( $form_id );
-
- if ( ! $form ) {
- esc_html_e( __( 'Unknown Form', 'viget-form-blocks' ) );
- return;
- }
-
- printf(
- '%s',
- esc_attr( $form->get_form_object()->get_id() ),
- esc_html( $form->get_form_object()->get_name() )
- );
-
- return;
- }
- },
- 10,
- 2
- );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Traits/ChildFields.php b/wp-content/plugins/viget-form-blocks/classes/Traits/ChildFields.php
deleted file mode 100644
index 2a0a85df..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Traits/ChildFields.php
+++ /dev/null
@@ -1,49 +0,0 @@
-get_form();
- }
-
- $fields = $form->get_form_object()->get_all_fields();
- $children = [];
-
- if ( 'fieldset' !== $this->get_block_name() ) {
- return $children;
- }
-
- foreach ( $fields as $field ) {
- if ( ! $field->get_parent_id() ) {
- continue;
- }
-
- if ( $this->get_id() === $field->get_parent_id() ) {
- $children[ $field->get_id() ] = $field;
- }
- }
-
- return $children;
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Traits/Options.php b/wp-content/plugins/viget-form-blocks/classes/Traits/Options.php
deleted file mode 100644
index 8f4725ff..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Traits/Options.php
+++ /dev/null
@@ -1,47 +0,0 @@
-get_field_data( 'options' );
- $options = [];
-
- if ( ! $opts ) {
- return $options;
- }
-
- foreach ( $opts as $option ) {
- if ( ! $option['label'] && ! $option['value'] ) {
- continue;
- }
-
- $value = $option['custom'] ? $option['value'] : $option['label'];
-
- if ( $option['default'] && ! $this->get_default_value() ) {
- $this->set_default_value( $value );
- }
-
- $options[] = [
- 'label' => $option['label'],
- 'value' => $value,
- ];
- }
-
- return $options;
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Utilities/Blocks.php b/wp-content/plugins/viget-form-blocks/classes/Utilities/Blocks.php
deleted file mode 100644
index cfa37859..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Utilities/Blocks.php
+++ /dev/null
@@ -1,115 +0,0 @@
-post_content;
- }
-
- return parse_blocks( self::$patterns[ $pattern_id ]->post_content );
- }
-
- /**
- * Prepare ACF block from WP Block Array
- *
- * @param array $block
- * @param array $context
- *
- * @return array
- */
- public static function prepare_acf_block( array $block, array $context = [] ): array {
- $attrs = $block['attrs'] ?? [];
- $attrs['id'] = acf_get_block_id( $attrs, $context );
- $attrs['id'] = acf_ensure_block_id_prefix( $attrs['id'] );
- return acf_prepare_block( $attrs );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Utilities/Cache.php b/wp-content/plugins/viget-form-blocks/classes/Utilities/Cache.php
deleted file mode 100644
index 70d7dfa2..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Utilities/Cache.php
+++ /dev/null
@@ -1,55 +0,0 @@
-form_id = $form->get_form_object()->get_id();
- }
-
- /**
- * Get the form instance.
- *
- * @return ?Form
- */
- public function get_form(): ?Form {
- return Form::find_form( $this->form_id );
- }
-
- /**
- * Add an error.
- *
- * @param Field $field
- * @param string $error_message
- *
- * @return void
- */
- public function add_error( Field $field, string $error_message ): void {
- $this->errors[ $field->get_id() ] = $error_message;
-
- $this->get_form()->update_cache();
- }
-
- /**
- * Check if the form has errors.
- *
- * @return bool
- */
- public function has_errors(): bool {
- if ( count( $this->errors ) ) {
- return true;
- }
-
- $form = $this->get_form();
-
- if ( ! $form->get_submission()->has_submit() ) {
- return false;
- }
-
- $fields = $form->get_form_object()->get_fields();
- $data = $form->get_submission()->get_data();
-
- foreach ( $fields as $field ) {
- if ( ! $field->is_required() ) {
- continue;
- }
-
- if ( ! empty( $data['content'][ $field->get_name() ]['value'] ) ) {
- continue;
- }
-
- $this->add_error( $field, $field->get_label() . ' ' . __( 'is required.', 'viget-form-blocks' ) );
- }
-
- return count( $this->errors ) > 0;
- }
-
- /**
- * Render the validation.
- *
- * @return void
- */
- public function render(): void {
- $form = $this->get_form();
- if ( ! $form->get_submission()->is_processed() ) {
- $block_id = $form->get_form_object()->get_id();
-
- printf(
- '',
- esc_attr( Form::HIDDEN_FORM_ID ),
- esc_attr( $block_id )
- );
-
- wp_nonce_field( 'form_submission', Form::HIDDEN_FORM_ID . '_' . $block_id . '_nonce' );
- }
-
- if ( empty( $this->errors ) ) {
- return;
- }
-
- printf(
- '%s
',
- implode( '
', $this->errors )
- );
- }
-}
diff --git a/wp-content/plugins/viget-form-blocks/classes/Views.php b/wp-content/plugins/viget-form-blocks/classes/Views.php
deleted file mode 100644
index cd27722e..00000000
--- a/wp-content/plugins/viget-form-blocks/classes/Views.php
+++ /dev/null
@@ -1,58 +0,0 @@
- true,
- ]
- );
-
- wp_register_script(
- 'VigetFormBlocks-conditional-logic',
- VGTFB_PLUGIN_URL . 'assets/js/conditional-logic.js',
- [ 'mf-conditional-fields' ],
- VGTFB_VERSION,
- [
- 'in_footer' => true,
- ]
- );
- }
-);
-
-add_action(
- 'admin_enqueue_scripts',
- function () {
- wp_enqueue_style(
- 'VigetFormBlocks-admin',
- VGTFB_PLUGIN_URL . 'assets/css/admin.css',
- [],
- VGTFB_VERSION
- );
-
- wp_enqueue_script(
- 'VigetFormBlocks-admin',
- VGTFB_PLUGIN_URL . 'assets/js/admin.js',
- [],
- VGTFB_VERSION
- );
-
- wp_localize_script(
- 'VigetFormBlocks-admin',
- 'acffbAdmin',
- [
- 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
- 'nonce' => wp_create_nonce( 'acffb' ),
- ]
- );
- }
-);
diff --git a/wp-content/plugins/viget-form-blocks/includes/block-fields.php b/wp-content/plugins/viget-form-blocks/includes/block-fields.php
deleted file mode 100644
index 3de41013..00000000
--- a/wp-content/plugins/viget-form-blocks/includes/block-fields.php
+++ /dev/null
@@ -1,1467 +0,0 @@
- 'group_6683facdcf97c',
- 'title' => 'Block: Field',
- 'fields' => array(
- array(
- 'key' => 'field_6683facee1fbc',
- 'label' => 'Placeholder',
- 'name' => 'placeholder',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'maxlength' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/input',
- ),
- ),
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/textarea',
- ),
- ),
- ),
- 'menu_order' => 0,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 0,
- ) );
-
- acf_add_local_field_group( array(
- 'key' => 'group_668327fbcea85',
- 'title' => 'Block: Form',
- 'fields' => array(
- array(
- 'key' => 'field_6684014a8bd1f',
- 'label' => 'Form Settings',
- 'name' => '',
- 'aria-label' => '',
- 'type' => 'accordion',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'open' => 1,
- 'multi_expand' => 1,
- 'endpoint' => 0,
- ),
- array(
- 'key' => 'field_668327fcca5b6',
- 'label' => 'Form Method',
- 'name' => 'method',
- 'aria-label' => '',
- 'type' => 'button_group',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 'POST' => 'POST',
- 'GET' => 'GET',
- 'DIALOG' => 'DIALOG',
- ),
- 'default_value' => 'POST',
- 'return_format' => 'value',
- 'allow_null' => 0,
- 'layout' => 'horizontal',
- ),
- array(
- 'key' => 'field_6684017c8bd20',
- 'label' => 'Submission',
- 'name' => '',
- 'aria-label' => '',
- 'type' => 'accordion',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'open' => 0,
- 'multi_expand' => 1,
- 'endpoint' => 0,
- ),
- array(
- 'key' => 'field_66992c02d61ed',
- 'label' => 'Save to Database?',
- 'name' => 'save_data',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 1,
- 'ui_on_text' => '',
- 'ui_off_text' => '',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_66832f771e208',
- 'label' => 'Confirmation',
- 'name' => 'confirmation',
- 'aria-label' => '',
- 'type' => 'button_group',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 'message' => 'Message',
- 'redirect' => 'Redirect',
- 'content' => 'Page Content',
- ),
- 'default_value' => 'message',
- 'return_format' => 'value',
- 'allow_null' => 0,
- 'layout' => 'horizontal',
- ),
- array(
- 'key' => 'field_66832f9c1e209',
- 'label' => 'Message',
- 'name' => 'message',
- 'aria-label' => '',
- 'type' => 'textarea',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66832f771e208',
- 'operator' => '==',
- 'value' => 'message',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => 'Thank you for your submission!',
- 'maxlength' => '',
- 'rows' => '',
- 'placeholder' => '',
- 'new_lines' => '',
- ),
- array(
- 'key' => 'field_668952d3e1d7f',
- 'label' => 'Page',
- 'name' => 'page',
- 'aria-label' => '',
- 'type' => 'post_object',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66832f771e208',
- 'operator' => '==',
- 'value' => 'redirect',
- ),
- array(
- 'field' => 'field_66895376e1d81',
- 'operator' => '!=',
- 'value' => '1',
- ),
- ),
- array(
- array(
- 'field' => 'field_66832f771e208',
- 'operator' => '==',
- 'value' => 'content',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'post_type' => array(
- 0 => 'page',
- ),
- 'post_status' => '',
- 'taxonomy' => '',
- 'return_format' => 'object',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'bidirectional' => 0,
- 'ui' => 1,
- 'bidirectional_target' => array(
- ),
- ),
- array(
- 'key' => 'field_66895376e1d81',
- 'label' => 'Custom URL',
- 'name' => 'custom_url',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66832f771e208',
- 'operator' => '==',
- 'value' => 'redirect',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 0,
- 'ui_on_text' => '',
- 'ui_off_text' => '',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_66832fbc1e20a',
- 'label' => 'Redirect URL',
- 'name' => 'redirect',
- 'aria-label' => '',
- 'type' => 'url',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66832f771e208',
- 'operator' => '==',
- 'value' => 'redirect',
- ),
- array(
- 'field' => 'field_66895376e1d81',
- 'operator' => '==',
- 'value' => '1',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'placeholder' => 'https://',
- ),
- array(
- 'key' => 'field_66895ea1c1062',
- 'label' => 'Notification',
- 'name' => '',
- 'aria-label' => '',
- 'type' => 'accordion',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'open' => 1,
- 'multi_expand' => 1,
- 'endpoint' => 0,
- ),
- array(
- 'key' => 'field_66895ec6c1063',
- 'label' => 'Site Admin Email',
- 'name' => 'admin_email',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 1,
- 'ui_on_text' => 'Enabled',
- 'ui_off_text' => 'Disabled',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_669eb7e04224d',
- 'label' => 'Admin Template',
- 'name' => 'admin_template',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66895ec6c1063',
- 'operator' => '==',
- 'value' => '1',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 0 => 'All Fields',
- ),
- 'default_value' => 0,
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 1,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- array(
- 'key' => 'field_66895efdc1064',
- 'label' => 'Confirmation Email',
- 'name' => 'confirmation_email',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => 'Form must have an Email field.',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 1,
- 'ui_on_text' => 'Enabled',
- 'ui_off_text' => 'Disabled',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_669eb8184224e',
- 'label' => 'Confirmation Template',
- 'name' => 'confirmation_template',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66895efdc1064',
- 'operator' => '==',
- 'value' => '1',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 0 => 'All Fields',
- ),
- 'default_value' => 0,
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 1,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- array(
- 'key' => 'field_66895f4bc1065',
- 'label' => 'Custom Email',
- 'name' => 'custom_email',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 0,
- 'ui_on_text' => 'Enabled',
- 'ui_off_text' => 'Disabled',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_66895f71c1066',
- 'label' => 'Email Recipient',
- 'name' => 'email_recipient',
- 'aria-label' => '',
- 'type' => 'email',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66895f4bc1065',
- 'operator' => '==',
- 'value' => '1',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'placeholder' => 'name@domain.com',
- 'prepend' => '',
- 'append' => '',
- ),
- array(
- 'key' => 'field_669eb8394224f',
- 'label' => 'Custom Template',
- 'name' => 'custom_template',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66895f4bc1065',
- 'operator' => '==',
- 'value' => '1',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 0 => 'All Fields',
- ),
- 'default_value' => 0,
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 1,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/form',
- ),
- ),
- ),
- 'menu_order' => 0,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 0,
- ) );
-
- acf_add_local_field_group( array(
- 'key' => 'group_669ea8d6ef54a',
- 'title' => 'Block: Form Data',
- 'fields' => array(
- array(
- 'key' => 'field_669ea8d7298be',
- 'label' => 'Form Field',
- 'name' => 'form_field',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 0 => 'Select a Field',
- ),
- 'default_value' => 0,
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- array(
- 'key' => 'field_669eb519e254c',
- 'label' => 'Label',
- 'name' => 'show_label',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 1,
- 'ui_on_text' => 'Show',
- 'ui_off_text' => 'Hide',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_669eb53ce254d',
- 'label' => 'Value',
- 'name' => 'show_value',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 1,
- 'ui_on_text' => 'Show',
- 'ui_off_text' => 'Hide',
- 'ui' => 1,
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/form-data',
- ),
- ),
- ),
- 'menu_order' => 0,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 0,
- ) );
-
- acf_add_local_field_group( array(
- 'key' => 'group_66a7b9112a9b3',
- 'title' => 'Block: Form Meta',
- 'fields' => array(
- array(
- 'key' => 'field_66a7b91132f2d',
- 'label' => 'Meta Field',
- 'name' => 'meta_field',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 0 => 'Select Meta',
- ),
- 'default_value' => 0,
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- array(
- 'key' => 'field_66a7b91133327',
- 'label' => 'Label',
- 'name' => 'show_label',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 1,
- 'ui_on_text' => 'Show',
- 'ui_off_text' => 'Hide',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_66a7b9113370e',
- 'label' => 'Value',
- 'name' => 'show_value',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 1,
- 'ui_on_text' => 'Show',
- 'ui_off_text' => 'Hide',
- 'ui' => 1,
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/form-meta',
- ),
- ),
- ),
- 'menu_order' => 0,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 0,
- ) );
-
- acf_add_local_field_group( array(
- 'key' => 'group_66970a1373563',
- 'title' => 'Block: Select',
- 'fields' => array(
- array(
- 'key' => 'field_66970a1340d39',
- 'label' => 'Allow Multiple',
- 'name' => 'allow_multiple',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 0,
- 'ui_on_text' => '',
- 'ui_off_text' => '',
- 'ui' => 1,
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/select',
- ),
- ),
- ),
- 'menu_order' => 0,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 0,
- ) );
-
- acf_add_local_field_group( array(
- 'key' => 'group_66903c8f9103f',
- 'title' => 'Block: Checkbox',
- 'fields' => array(
- array(
- 'key' => 'field_66903fac1f7c1',
- 'label' => 'Checkbox Value',
- 'name' => 'checkbox_value',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 0,
- 'ui_on_text' => 'Custom',
- 'ui_off_text' => 'Use Label',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_66903c90f056e',
- 'label' => 'Value',
- 'name' => 'value',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66903fac1f7c1',
- 'operator' => '==',
- 'value' => '1',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => 1,
- 'maxlength' => '',
- 'placeholder' => 'Value when checked',
- 'prepend' => '',
- 'append' => '',
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/checkbox',
- ),
- ),
- ),
- 'menu_order' => 7,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 0,
- ) );
-
- acf_add_local_field_group( array(
- 'key' => 'group_66832bf2f293a',
- 'title' => 'Block: Input',
- 'fields' => array(
- array(
- 'key' => 'field_66832bf3c10aa',
- 'label' => 'Input Type',
- 'name' => 'type',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 'text' => 'Text',
- 'email' => 'Email',
- 'url' => 'URL',
- 'tel' => 'Phone',
- 'number' => 'Number',
- 'password' => 'Password',
- 'file' => 'File/Upload',
- 'datetime-local' => 'Date/Time',
- 'date' => 'Date',
- 'time' => 'Time',
- 'color' => 'Color Picker',
- 'hidden' => 'Hidden',
- ),
- 'default_value' => 'text',
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- ),
- array(
- 'key' => 'field_669718dcc6615',
- 'label' => 'Default Value',
- 'name' => 'default_value',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'maxlength' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- ),
- array(
- 'key' => 'field_66886c0865624',
- 'label' => 'Max Length',
- 'name' => 'maxlength',
- 'aria-label' => '',
- 'type' => 'number',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'min' => '',
- 'max' => '',
- 'placeholder' => '',
- 'step' => '',
- 'prepend' => '',
- 'append' => '',
- ),
- array(
- 'key' => 'field_66848acde5856',
- 'label' => 'Controls',
- 'name' => 'controls',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66832bf3c10aa',
- 'operator' => '==',
- 'value' => 'number',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 1,
- 'ui_on_text' => 'Enabled',
- 'ui_off_text' => 'Disabled',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_668865b10c6a5',
- 'label' => 'Controls Settings',
- 'name' => 'controls_settings',
- 'aria-label' => '',
- 'type' => 'group',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66832bf3c10aa',
- 'operator' => '==',
- 'value' => 'number',
- ),
- array(
- 'field' => 'field_66848acde5856',
- 'operator' => '==',
- 'value' => '1',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'layout' => 'block',
- 'sub_fields' => array(
- array(
- 'key' => 'field_668865d10c6a7',
- 'label' => 'Min',
- 'name' => 'min',
- 'aria-label' => '',
- 'type' => 'number',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '33.33',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'min' => '',
- 'max' => '',
- 'placeholder' => '',
- 'step' => '',
- 'prepend' => '',
- 'append' => '',
- ),
- array(
- 'key' => 'field_668865ef0c6a8',
- 'label' => 'Max',
- 'name' => 'max',
- 'aria-label' => '',
- 'type' => 'number',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '33.33',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'min' => '',
- 'max' => '',
- 'placeholder' => '',
- 'step' => '',
- 'prepend' => '',
- 'append' => '',
- ),
- array(
- 'key' => 'field_6688660c0c6a9',
- 'label' => 'Step',
- 'name' => 'step',
- 'aria-label' => '',
- 'type' => 'number',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '33.33',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => 1,
- 'min' => '',
- 'max' => '',
- 'placeholder' => '',
- 'step' => '',
- 'prepend' => '',
- 'append' => '',
- ),
- ),
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/input',
- ),
- ),
- ),
- 'menu_order' => 10,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 0,
- ) );
-
- acf_add_local_field_group( array(
- 'key' => 'group_668478504f2b5',
- 'title' => 'Options',
- 'fields' => array(
- array(
- 'key' => 'field_66847850b53b2',
- 'label' => 'Options',
- 'name' => 'options',
- 'aria-label' => '',
- 'type' => 'repeater',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'layout' => 'block',
- 'pagination' => 0,
- 'min' => 0,
- 'max' => 0,
- 'collapsed' => '',
- 'button_label' => 'Add Option',
- 'rows_per_page' => 20,
- 'sub_fields' => array(
- array(
- 'key' => 'field_668478b1b53b6',
- 'label' => 'Default',
- 'name' => 'default',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 0,
- 'ui' => 0,
- 'ui_on_text' => '',
- 'ui_off_text' => '',
- 'parent_repeater' => 'field_66847850b53b2',
- ),
- array(
- 'key' => 'field_66847892b53b5',
- 'label' => 'Custom',
- 'name' => 'custom',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 0,
- 'ui' => 0,
- 'ui_on_text' => '',
- 'ui_off_text' => '',
- 'parent_repeater' => 'field_66847850b53b2',
- ),
- array(
- 'key' => 'field_66847869b53b3',
- 'label' => 'Option',
- 'name' => 'label',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'maxlength' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'parent_repeater' => 'field_66847850b53b2',
- ),
- array(
- 'key' => 'field_66847882b53b4',
- 'label' => 'Value',
- 'name' => 'value',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_66847892b53b5',
- 'operator' => '==',
- 'value' => '1',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'maxlength' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'parent_repeater' => 'field_66847850b53b2',
- ),
- ),
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/select',
- ),
- ),
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/radios',
- ),
- ),
- ),
- 'menu_order' => 10,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 0,
- ) );
-
- acf_add_local_field_group( array(
- 'key' => 'group_668c18f9290d7',
- 'title' => 'Conditional Logic',
- 'fields' => array(
- array(
- 'key' => 'field_668c18f9beb53',
- 'label' => 'Conditional Logic',
- 'name' => '',
- 'aria-label' => '',
- 'type' => 'accordion',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'open' => 0,
- 'multi_expand' => 1,
- 'endpoint' => 0,
- ),
- array(
- 'key' => 'field_668c1944ef703',
- 'label' => '',
- 'name' => 'enable_conditional_logic',
- 'aria-label' => '',
- 'type' => 'true_false',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'message' => '',
- 'default_value' => 0,
- 'ui_on_text' => 'Enabled',
- 'ui_off_text' => 'Disabled',
- 'ui' => 1,
- ),
- array(
- 'key' => 'field_668c1a238cccd',
- 'label' => 'Conditional Logic',
- 'name' => 'conditional_logic',
- 'aria-label' => '',
- 'type' => 'repeater',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_668c1944ef703',
- 'operator' => '==',
- 'value' => '1',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'layout' => 'block',
- 'pagination' => 0,
- 'min' => 0,
- 'max' => 0,
- 'collapsed' => '',
- 'button_label' => 'Add Condition',
- 'rows_per_page' => 20,
- 'sub_fields' => array(
- array(
- 'key' => 'field_668c1a578ccce',
- 'label' => 'Action',
- 'name' => 'action',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 'show' => 'Show',
- 'hide' => 'Hide',
- 'enable' => 'Enable',
- 'disable' => 'Disable',
- ),
- 'default_value' => 'show',
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- 'parent_repeater' => 'field_668c1a238cccd',
- ),
- array(
- 'key' => 'field_668c1b138ccd0',
- 'label' => 'When this field',
- 'name' => 'field',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- '-' => 'N/A',
- ),
- 'default_value' => '-',
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- 'parent_repeater' => 'field_668c1a238cccd',
- ),
- array(
- 'key' => 'field_668c1aaa8cccf',
- 'label' => 'Meets this requirement',
- 'name' => 'condition',
- 'aria-label' => '',
- 'type' => 'select',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => 0,
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'choices' => array(
- 'isnotempty' => 'Has any value',
- 'isempty' => 'Has no value',
- 'is' => 'Has specific value',
- 'isnot' => 'Does not have specific value',
- 'greaterthan' => 'Is greater than',
- 'lessthan' => 'Is less than',
- 'contains' => 'Contains',
- 'doesnotcontain' => 'Does not contain',
- 'beginswith' => 'Begins With',
- 'doesnotbeginwith' => 'Does not begin with',
- ),
- 'default_value' => 'not_empty',
- 'return_format' => 'value',
- 'multiple' => 0,
- 'allow_null' => 0,
- 'ui' => 0,
- 'ajax' => 0,
- 'placeholder' => '',
- 'parent_repeater' => 'field_668c1a238cccd',
- ),
- array(
- 'key' => 'field_668c1bf3f5729',
- 'label' => 'Value',
- 'name' => 'value',
- 'aria-label' => '',
- 'type' => 'text',
- 'instructions' => '',
- 'required' => 0,
- 'conditional_logic' => array(
- array(
- array(
- 'field' => 'field_668c1aaa8cccf',
- 'operator' => '!=',
- 'value' => 'isnotempty',
- ),
- array(
- 'field' => 'field_668c1aaa8cccf',
- 'operator' => '!=',
- 'value' => 'isempty',
- ),
- ),
- ),
- 'wrapper' => array(
- 'width' => '',
- 'class' => '',
- 'id' => '',
- ),
- 'default_value' => '',
- 'maxlength' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'parent_repeater' => 'field_668c1a238cccd',
- ),
- ),
- ),
- ),
- 'location' => array(
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/input',
- ),
- ),
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/radios',
- ),
- ),
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/select',
- ),
- ),
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/textarea',
- ),
- ),
- array(
- array(
- 'param' => 'block',
- 'operator' => '==',
- 'value' => 'acf/submit',
- ),
- ),
- ),
- 'menu_order' => 90,
- 'position' => 'normal',
- 'style' => 'default',
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'hide_on_screen' => '',
- 'active' => true,
- 'description' => '',
- 'show_in_rest' => 0,
- ) );
- } );
- }
-);
diff --git a/wp-content/plugins/viget-form-blocks/includes/conditional-logic.php b/wp-content/plugins/viget-form-blocks/includes/conditional-logic.php
deleted file mode 100644
index 2f40f132..00000000
--- a/wp-content/plugins/viget-form-blocks/includes/conditional-logic.php
+++ /dev/null
@@ -1,37 +0,0 @@
-get_form_object()->get_fields() as $form_field ) {
- if ( $form_field->get_name() === $block_id ) {
- continue;
- }
- $field['choices'][ $form_field->get_name() ] = $form_field->get_label();
- }
-
- if ( empty( $field['choices'] ) ) {
- $field['choices'] = [
- '' => 'Save changes to update options.',
- ];
- }
-
- return $field;
- }
-);
diff --git a/wp-content/plugins/viget-form-blocks/includes/helpers.php b/wp-content/plugins/viget-form-blocks/includes/helpers.php
deleted file mode 100644
index 172c1758..00000000
--- a/wp-content/plugins/viget-form-blocks/includes/helpers.php
+++ /dev/null
@@ -1,47 +0,0 @@
- 'forms',
- 'title' => __( 'Forms', 'viget-form-blocks' ),
- ];
- $categories[] = [
- 'slug' => 'form-data',
- 'title' => __( 'Form Data', 'viget-form-blocks' ),
- ];
- return $categories;
- }
-);
-
-add_action(
- 'acf/init',
- function() {
- acf_add_options_page(
- [
- 'page_title' => __( 'Form Blocks Admin', 'viget-form-blocks' ),
- 'menu_slug' => 'acffb-forms',
- 'menu_title' => __( 'Form Blocks', 'viget-form-blocks' ),
- 'position' => 20,
- 'redirect' => false,
- 'description' => __( 'Admin for Form Blocks', 'viget-form-blocks' ),
- 'menu_icon' => [
- 'type' => 'dashicons',
- 'value' => 'dashicons-feedback',
- ],
- 'updated_message' => __( 'Settings Updated', 'viget-form-blocks' ),
- 'capability' => 'manage_options',
- 'autoload' => true,
- 'icon_url' => 'dashicons-feedback',
- ]
- );
- }
-);
-
diff --git a/wp-content/plugins/viget-form-blocks/views/parts/email-footer.php b/wp-content/plugins/viget-form-blocks/views/parts/email-footer.php
deleted file mode 100644
index 00ebed80..00000000
--- a/wp-content/plugins/viget-form-blocks/views/parts/email-footer.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-