PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.0.03
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.0.03
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/FrmHooksController.php +15 -61 6.45.0.03 View file →
@@ -6,12 +6,8 @@
6 6 class FrmHooksController {
7 7
8 8 /**
9 9 * Trigger plugin-wide hook loading
10 - *
11 - * @param string $hooks
12 - *
13 - * @return void
14 10 */
15 11 public static function trigger_load_hook( $hooks = 'load_hooks' ) {
16 12 $controllers = apply_filters( 'frm_load_controllers', array( 'FrmHooksController' ) );
17 13
@@ -38,11 +34,9 @@
38 34
39 35 // Instansiate Controllers.
40 36 foreach ( $controllers as $c ) {
41 37 foreach ( $hooks as $hook ) {
42 - if ( is_callable( array( $c, $hook ) ) ) {
43 - call_user_func( array( $c, $hook ) );
44 - }
38 + call_user_func( array( $c, $hook ) );
45 39 unset( $hook );
46 40 }
47 41 unset( $c );
48 42 }
@@ -48,18 +42,12 @@
48 42 }
49 43
50 44 }
51 45
52 - /**
53 - * @return void
54 - */
55 46 public static function trigger_load_form_hooks() {
56 47 self::trigger_load_hook( 'load_form_hooks' );
57 48 }
58 49
59 - /**
60 - * @return void
61 - */
62 50 public static function load_hooks() {
63 51 add_action( 'rest_api_init', 'FrmAppController::create_rest_routes', 0 );
64 52 add_action( 'plugins_loaded', 'FrmAppController::load_lang' );
65 53 add_filter( 'widget_text', 'do_shortcode' );
@@ -102,22 +90,17 @@
102 90 * FrmProContent::replace_single_shortcode() applies this filter like 'frm_keep_' . $field->type . '_value_array'
103 91 */
104 92 add_filter( 'frm_keep_name_value_array', '__return_true' );
105 93
106 - // Elementor.
107 - add_action( 'elementor/widgets/register', 'FrmElementorController::register_elementor_hooks' );
108 - add_filter( 'frm_fields_in_form_builder', 'FrmFormsController::update_form_builder_fields', 10, 2 );
94 + add_action( 'elementor/widgets/widgets_registered', 'FrmHooksController::register_elementor_hooks' );
109 95 }
110 96
111 - /**
112 - * @return void
113 - */
114 97 public static function load_admin_hooks() {
115 98 add_action( 'admin_menu', 'FrmAppController::menu', 1 );
116 99 add_filter( 'admin_body_class', 'FrmAppController::add_admin_class', 999 );
100 + add_action( 'admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style' );
117 101 add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' );
118 102 add_action( 'admin_init', 'FrmAppController::admin_init', 11 );
119 - add_action( 'admin_enqueue_scripts', 'FrmAppController::admin_enqueue_scripts' );
120 103 add_filter( 'plugin_action_links_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::settings_link' );
121 104 add_filter( 'admin_footer_text', 'FrmAppController::set_footer_text' );
122 105 add_action( 'wp_ajax_frm_dismiss_review', 'FrmAppController::dismiss_review' );
123 106
@@ -123,8 +106,9 @@
123 106
124 107 // Addons Controller.
125 108 add_action( 'admin_menu', 'FrmAddonsController::menu', 100 );
126 109 add_filter( 'pre_set_site_transient_update_plugins', 'FrmAddonsController::check_update' );
110 + add_action( 'frm_page_footer', 'FrmAppHelper::renewal_message' );
127 111
128 112 // Entries Controller.
129 113 add_action( 'admin_menu', 'FrmEntriesController::menu', 12 );
130 114 add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 );
@@ -144,12 +128,8 @@
144 128 add_action( 'frm_after_field_options', 'FrmFormsController::logic_tip' );
145 129
146 130 add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 );
147 131 add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' );
148 -
149 - // Elementor.
150 - add_action( 'elementor/editor/footer', 'FrmElementorController::admin_init' );
151 -
152 132 add_action( 'media_buttons', 'FrmFormsController::insert_form_button' );
153 133 add_action( 'et_pb_admin_excluded_shortcodes', 'FrmFormsController::prevent_divi_conflict' );
154 134
155 135 // Forms Model.
@@ -166,11 +146,9 @@
166 146 add_action( 'wp_ajax_frm_page_search', 'FrmSettingsController::page_search' );
167 147
168 148 // Styles Controller.
169 149 add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
170 - add_action( 'plugins_loaded', 'FrmStylesController::plugins_loaded' );
171 150 add_action( 'admin_init', 'FrmStylesController::admin_init' );
172 - add_action( 'wp_default_styles', 'FrmStylesController::disable_conflicting_wp_admin_css', 11 ); // Use 11 so it happens after add_action( 'wp_default_styles', 'wp_default_styles' ); where edit.css is added.
173 151
174 152 // XML Controller.
175 153 add_action( 'admin_menu', 'FrmXMLController::menu', 41 );
176 154
@@ -178,24 +156,13 @@
178 156 add_action( 'enqueue_block_editor_assets', 'FrmSimpleBlocksController::block_editor_assets' );
179 157
180 158 add_action( 'admin_init', 'FrmUsageController::schedule_send' );
181 159
182 - // Applications Controller.
183 - add_action( 'admin_menu', 'FrmApplicationsController::menu', 14 ); // Use the same priority as styles so Applications appear directly under Styles.
184 - add_action( 'admin_enqueue_scripts', 'FrmApplicationsController::dequeue_scripts', 15 );
185 - add_action( 'wp_ajax_frm_get_applications_data', 'FrmApplicationsController::get_applications_data' );
186 -
187 - // CAPTCHA
188 - add_filter( 'frm_setup_edit_field_vars', 'FrmFieldCaptcha::update_field_name' );
189 -
190 160 FrmSMTPController::load_hooks();
191 161 FrmWelcomeController::load_hooks();
192 162 new FrmPluginSearch();
193 163 }
194 164
195 - /**
196 - * @return void
197 - */
198 165 public static function load_ajax_hooks() {
199 166 add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' );
200 167 add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
201 168 add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
@@ -226,10 +193,8 @@
226 193 add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' );
227 194 add_action( 'wp_ajax_frm_forms_trash', 'FrmFormsController::ajax_trash' );
228 195 add_action( 'wp_ajax_frm_install_form', 'FrmFormsController::build_new_form' );
229 196 add_action( 'wp_ajax_frm_build_template', 'FrmFormsController::build_template' );
230 - add_action( 'wp_ajax_frm_create_page_with_shortcode', 'FrmFormsController::create_page_with_shortcode' );
231 - add_action( 'wp_ajax_get_page_dropdown', 'FrmFormsController::get_page_dropdown' );
232 197
233 198 add_action( 'wp_ajax_frm_dismiss_migrator', 'FrmFormMigratorsHelper::dismiss_migrator' );
234 199
235 200 // Inbox.
@@ -244,9 +209,8 @@
244 209 add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' );
245 210 add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' );
246 211 add_action( 'wp_ajax_frmpro_css', 'FrmStylesController::load_saved_css' );
247 212 add_action( 'wp_ajax_nopriv_frmpro_css', 'FrmStylesController::load_saved_css' );
248 - add_action( 'wp_ajax_frm_rename_style', 'FrmStylesController::rename_style' );
249 213
250 214 // XML Controller.
251 215 add_action( 'wp_ajax_frm_install_template', 'FrmXMLController::install_template' );
252 216 add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' );
@@ -254,16 +218,10 @@
254 218 add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
255 219
256 220 // Templates API.
257 221 add_action( 'wp_ajax_template_api_signup', 'FrmFormTemplateApi::signup' );
258 -
259 - // Submit with AJAX.
260 - add_action( 'wp_loaded', 'FrmEntriesAJAXSubmitController::ajax_create', 5 ); // Trigger before process_entry.
261 222 }
262 223
263 - /**
264 - * @return void
265 - */
266 224 public static function load_form_hooks() {
267 225 // Fields Controller.
268 226 add_filter( 'frm_field_type', 'FrmFieldsController::change_type' );
269 227 add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' );
@@ -271,25 +229,17 @@
271 229 add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
272 230
273 231 // Forms Controller.
274 232 add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' );
275 - add_filter( 'frm_submit_button_class', 'FrmFormsController::update_button_classes' );
276 - add_filter( 'frm_back_button_class', 'FrmFormsController::update_button_classes' );
277 233
278 234 // Styles Controller.
279 235 add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
280 236 }
281 237
282 - /**
283 - * @return void
284 - */
285 238 public static function load_view_hooks() {
286 239 // Hooks go here when a view is loaded.
287 240 }
288 241
289 - /**
290 - * @return void
291 - */
292 242 public static function load_multisite_hooks() {
293 243 add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' );
294 244
295 245 // Drop tables when mu site is deleted.
@@ -295,14 +245,18 @@
295 245 // Drop tables when mu site is deleted.
296 246 add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
297 247 }
298 248
299 - /**
300 - * @deprecated 5.0.06 use FrmElementorController::register_elementor_hooks directly.
301 - *
302 - * @return void
303 - */
304 249 public static function register_elementor_hooks() {
305 - _deprecated_function( __FUNCTION__, '5.0.06', 'FrmElementorController::register_elementor_hooks' );
306 - FrmElementorController::register_elementor_hooks();
250 + require_once FrmAppHelper::plugin_path() . '/classes/widgets/FrmElementorWidget.php';
251 + \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \FrmElementorWidget() );
252 +
253 + if ( is_admin() ) {
254 + add_action(
255 + 'elementor/editor/after_enqueue_styles',
256 + function() {
257 + wp_enqueue_style( 'font_icons', FrmAppHelper::plugin_url() . '/css/font_icons.css', array(), FrmAppHelper::plugin_version() );
258 + }
259 + );
260 + }
307 261 }
308 262 }