PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.0.14
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.0.14
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmSimpleBlocksController.php +3 -37 6.45.0.14 View file →
@@ -6,10 +6,8 @@
6 6 class FrmSimpleBlocksController {
7 7
8 8 /**
9 9 * Enqueue Formidable Simple Blocks' js and CSS for editor in admin.
10 - *
11 - * @return void
12 10 */
13 11 public static function block_editor_assets() {
14 12 $version = FrmAppHelper::plugin_version();
15 13
@@ -15,9 +13,9 @@
15 13
16 14 wp_register_script(
17 15 'formidable-form-selector',
18 16 FrmAppHelper::plugin_url() . '/js/formidable_blocks.js',
19 - array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-block-editor' ),
17 + array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-editor' ),
20 18 $version,
21 19 true
22 20 );
23 21
@@ -32,10 +30,8 @@
32 30 if ( $block_name === 'Formidable' ) {
33 31 $block_name = 'Formidable Forms';
34 32 }
35 33
36 - $modal_addon = self::get_modal_addon_info();
37 -
38 34 $script_vars = array(
39 35 'forms' => self::get_forms_options(),
40 36 'icon' => $icon,
41 37 'name' => $block_name,
@@ -40,12 +36,8 @@
40 36 'icon' => $icon,
41 37 'name' => $block_name,
42 38 'link' => FrmAppHelper::admin_upgrade_link( 'block' ),
43 39 'url' => FrmAppHelper::plugin_url(),
44 - 'modalAddon' => array(
45 - 'link' => FrmAppHelper::admin_upgrade_link( 'addons', $modal_addon['link'] ),
46 - 'hasAccess' => ! empty( $modal_addon['url'] ),
47 - ),
48 40 );
49 41
50 42 wp_localize_script( 'formidable-form-selector', 'formidable_form_selector', $script_vars );
51 43 if ( function_exists( 'wp_set_script_translations' ) ) {
@@ -60,27 +52,8 @@
60 52 );
61 53 }
62 54
63 55 /**
64 - * Gets the modal addon info.
65 - *
66 - * @since 6.3.2
67 - *
68 - * @return array|false
69 - */
70 - private static function get_modal_addon_info() {
71 - $api = new FrmFormApi();
72 - $addons = $api->get_api_info();
73 - $addon_id = 185013;
74 -
75 - if ( ! is_array( $addons ) || ! array_key_exists( $addon_id, $addons ) ) {
76 - return false;
77 - }
78 -
79 - return $addons[ $addon_id ];
80 - }
81 -
82 - /**
83 56 * Returns a filtered list of form options with the name as label and the id as value, sorted by label
84 57 *
85 58 * @return array
86 59 */
@@ -116,10 +89,8 @@
116 89 }
117 90
118 91 /**
119 92 * Registers simple form block
120 - *
121 - * @return void
122 93 */
123 94 public static function register_simple_form_block() {
124 95 if ( ! is_callable( 'register_block_type' ) ) {
125 96 return;
@@ -159,9 +130,10 @@
159 130
160 131 /**
161 132 * Renders a form given the specified attributes.
162 133 *
163 - * @param array $attributes
134 + * @param $attributes
135 + *
164 136 * @return string
165 137 */
166 138 public static function simple_form_render( $attributes ) {
167 139 if ( ! isset( $attributes['formId'] ) ) {
@@ -166,14 +138,8 @@
166 138 public static function simple_form_render( $attributes ) {
167 139 if ( ! isset( $attributes['formId'] ) ) {
168 140 return '';
169 141 }
170 -
171 - /**
172 - * @since 5.5.2
173 - * @param array $attributes
174 - */
175 - do_action( 'frm_before_simple_form_render', $attributes );
176 142
177 143 $params = array_filter( $attributes );
178 144 $params['id'] = $params['formId'];
179 145 unset( $params['formId'] );