| @@ -65,8 +65,24 @@ | ||
| 65 | 65 | public function showFluentAddOns() |
| 66 | 66 | { |
| 67 | 67 | wp_enqueue_script('fluentform-modules'); |
| 68 | 68 | |
| 69 | + $addOns = $this->getRegisteredAddOns(); | |
| 70 | + | |
| 71 | + wp_localize_script('fluentform-modules', 'fluent_addon_modules', [ | |
| 72 | + 'addons' => $addOns, | |
| 73 | + 'has_pro' => defined('FLUENTFORMPRO'), | |
| 74 | + 'addOnModule_str' => TranslationString::getAddOnModuleI18n(), | |
| 75 | + ]); | |
| 76 | + | |
| 77 | + wpFluentForm('view')->render('admin.addons.list', []); | |
| 78 | + } | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * The registry the Add-on Modules screen renders from, so the status writer can validate against the same source. | |
| 82 | + */ | |
| 83 | + public function getRegisteredAddOns() | |
| 84 | + { | |
| 69 | 85 | $addOns = apply_filters_deprecated( |
| 70 | 86 | 'fluentform_global_addons', |
| 71 | 87 | [ |
| 72 | 88 | [], |
| @@ -89,15 +105,9 @@ | ||
| 89 | 105 | if (!defined('FLUENTFORMPRO')) { |
| 90 | 106 | $addOns = array_merge($addOns, $this->getPremiumAddOns()); |
| 91 | 107 | } |
| 92 | 108 | |
| 93 | - wp_localize_script('fluentform-modules', 'fluent_addon_modules', [ | |
| 94 | - 'addons' => $addOns, | |
| 95 | - 'has_pro' => defined('FLUENTFORMPRO'), | |
| 96 | - 'addOnModule_str' => TranslationString::getAddOnModuleI18n(), | |
| 97 | - ]); | |
| 98 | - | |
| 99 | - wpFluentForm('view')->render('admin.addons.list', []); | |
| 109 | + return $addOns; | |
| 100 | 110 | } |
| 101 | 111 | |
| 102 | 112 | public function getPremiumAddOns() |
| 103 | 113 | { |