| @@ -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 | |
| @@ -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'] ); |