PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.7.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.7.2
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 +32 -65 6.25.1 → 6.7.2 View file →
@@ -35,9 +35,9 @@
35 35 add_filter( 'frm' . str_replace( 'load', '', $trigger_hooks ) . '_loaded', '__return_true' );
36 36 }
37 37 unset( $trigger_hooks );
38 38
39 - // Instantiate Controllers.
39 + // Instansiate Controllers.
40 40 foreach ( $controllers as $c ) {
41 41 foreach ( $hooks as $hook ) {
42 42 if ( is_callable( array( $c, $hook ) ) ) {
43 43 call_user_func( array( $c, $hook ) );
@@ -45,8 +45,9 @@
45 45 unset( $hook );
46 46 }
47 47 unset( $c );
48 48 }
49 +
49 50 }
50 51
51 52 /**
52 53 * @return void
@@ -58,12 +59,10 @@
58 59 /**
59 60 * @return void
60 61 */
61 62 public static function load_hooks() {
62 - // Use 0 so this gets triggered before FrmFormActionsController::register_post_types.
63 - add_action( 'init', 'FrmAppController::load_lang', 0 );
64 -
65 63 add_action( 'rest_api_init', 'FrmAppController::create_rest_routes', 0 );
64 + add_action( 'plugins_loaded', 'FrmAppController::load_lang' );
66 65 add_filter( 'widget_text', 'do_shortcode' );
67 66
68 67 // Entries controller.
69 68 add_action( 'wp_loaded', 'FrmEntriesController::process_entry', 10, 0 );
@@ -71,9 +70,8 @@
71 70
72 71 // Form Actions Controller.
73 72 add_action( 'init', 'FrmFormActionsController::register_post_types', 1 );
74 73 add_action( 'frm_after_create_entry', 'FrmFormActionsController::trigger_create_actions', 20, 3 );
75 - add_filter( 'pre_wpml_is_translated_post_type', 'FrmFormActionsController::prevent_wpml_translations', 10, 2 );
76 74
77 75 // Forms Controller.
78 76 add_action( 'widgets_init', 'FrmFormsController::register_widgets' );
79 77 add_action( 'init', 'FrmFormsController::front_head' );
@@ -80,9 +78,8 @@
80 78 add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 );
81 79 add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 );
82 80 add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' );
83 81 add_action( 'wp_footer', 'FrmFormsController::footer_js', 1, 0 );
84 - add_action( 'wp_footer', 'FrmHoneypot::maybe_print_honeypot_js', 99 );
85 82
86 83 add_action( 'wp_scheduled_delete', 'FrmForm::scheduled_delete' );
87 84
88 85 // Form Shortcodes.
@@ -107,8 +104,9 @@
107 104 add_filter( 'frm_keep_name_value_array', '__return_true' );
108 105
109 106 // Elementor.
110 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 );
111 109
112 110 // Summary emails.
113 111 add_action( 'frm_daily_event', 'FrmEmailSummaryController::maybe_send_emails' );
114 112
@@ -113,12 +111,8 @@
113 111 add_action( 'frm_daily_event', 'FrmEmailSummaryController::maybe_send_emails' );
114 112
115 113 FrmTransLiteHooksController::load_hooks();
116 114 FrmStrpLiteHooksController::load_hooks();
117 - FrmSquareLiteHooksController::load_hooks();
118 -
119 - // GDPR
120 - add_filter( 'frm_is_field_required', 'FrmFieldGdpr::force_required_field', 10, 2 );
121 115 }
122 116
123 117 /**
124 118 * @return void
@@ -131,10 +125,14 @@
131 125 add_action( 'admin_enqueue_scripts', 'FrmAppController::admin_enqueue_scripts' );
132 126 add_filter( 'plugin_action_links_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::settings_link' );
133 127 add_filter( 'admin_footer_text', 'FrmAppController::set_footer_text' );
134 128 add_action( 'admin_footer', 'FrmAppController::add_admin_footer_links' );
135 - add_action( 'current_screen', 'FrmAppController::handle_current_screen' );
129 + add_action( 'wp_ajax_frm_dismiss_review', 'FrmAppController::dismiss_review' );
136 130
131 + // Addons Controller.
132 + add_action( 'admin_menu', 'FrmAddonsController::menu', 100 );
133 + add_filter( 'pre_set_site_transient_update_plugins', 'FrmAddonsController::check_update' );
134 +
137 135 // Entries Controller.
138 136 add_action( 'admin_menu', 'FrmEntriesController::menu', 12 );
139 137 add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 );
140 138 add_filter( 'update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5 );
@@ -142,10 +140,10 @@
142 140
143 141 // Form Actions Controller.
144 142 if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
145 143 add_action( 'frm_before_update_form_settings', 'FrmFormActionsController::update_settings' );
144 + add_action( 'frm_add_form_style_tab_options', 'FrmFormsController::add_form_style_tab_options' );
146 145 }
147 -
148 146 add_action( 'frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3 );
149 147
150 148 // Forms Controller.
151 149 add_action( 'admin_menu', 'FrmFormsController::menu', 10 );
@@ -150,9 +148,8 @@
150 148 // Forms Controller.
151 149 add_action( 'admin_menu', 'FrmFormsController::menu', 10 );
152 150 add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' );
153 151 add_action( 'frm_after_field_options', 'FrmFormsController::logic_tip' );
154 - add_filter( 'frm_fields_in_form_builder', 'FrmFormsController::update_form_builder_fields', 10, 2 );
155 152
156 153 add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 );
157 154 add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' );
158 155
@@ -164,12 +161,17 @@
164 161
165 162 // Forms Model.
166 163 add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 );
167 164
165 + // Inbox Controller.
166 + add_action( 'admin_menu', 'FrmInboxController::menu', 50 );
167 +
168 168 // Settings Controller.
169 169 add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
170 170 add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
171 - add_action( 'frm_after_settings_tabs', 'FrmSettingsController::settings_cta' );
171 + add_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' );
172 + add_action( 'wp_ajax_frm_settings_tab', 'FrmSettingsController::load_settings_tab' );
173 + add_action( 'wp_ajax_frm_page_search', 'FrmSettingsController::page_search' );
172 174
173 175 // Styles Controller.
174 176 add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
175 177 add_action( 'plugins_loaded', 'FrmStylesController::plugins_loaded' );
@@ -188,8 +190,9 @@
188 190 // Applications Controller.
189 191 // Use the same priority as styles so Applications appear directly under Styles.
190 192 add_action( 'admin_menu', 'FrmApplicationsController::menu', 14 );
191 193 add_action( 'admin_enqueue_scripts', 'FrmApplicationsController::dequeue_scripts', 15 );
194 + add_action( 'wp_ajax_frm_get_applications_data', 'FrmApplicationsController::get_applications_data' );
192 195
193 196 // CAPTCHA
194 197 add_filter( 'frm_setup_edit_field_vars', 'FrmFieldCaptcha::update_field_name' );
195 198
@@ -198,27 +201,12 @@
198 201
199 202 // Cronjob.
200 203 add_action( 'admin_init', 'FrmCronController::schedule_events' );
201 204
202 - // Cross sell.
203 - add_action( 'admin_menu', 'FrmSalesApi::menu', 1000 );
204 -
205 - // Deactivation feedback.
206 - add_action( 'admin_enqueue_scripts', 'FrmDeactivationFeedbackController::enqueue_assets' );
207 - add_action( 'admin_footer', 'FrmDeactivationFeedbackController::footer_html' );
208 - add_action( 'deactivated_plugin', 'FrmDeactivationFeedbackController::set_feedback_expired_date' );
209 -
210 - add_action( 'frm_email_styles_extra_settings', 'FrmEmailStylesController::show_upsell_settings' );
211 -
212 - add_action( 'admin_init', 'FrmWelcomeTourController::admin_init' );
213 -
214 - FrmDashboardController::load_admin_hooks();
215 205 FrmTransLiteHooksController::load_admin_hooks();
216 206 FrmStrpLiteHooksController::load_admin_hooks();
217 - FrmSquareLiteHooksController::load_admin_hooks();
218 207 FrmSMTPController::load_hooks();
219 - FrmOnboardingWizardController::load_admin_hooks();
220 - FrmAddonsController::load_admin_hooks();
208 + FrmWelcomeController::load_hooks();
221 209 new FrmPluginSearch();
222 210 }
223 211
224 212 /**
@@ -228,22 +216,14 @@
228 216 add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' );
229 217 add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
230 218 add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
231 219
232 - // Onboarding Wizard Controller.
233 - add_action( 'wp_ajax_frm_onboarding_consent_tracking', 'FrmOnboardingWizardController::ajax_consent_tracking' );
234 - add_action( 'wp_ajax_frm_onboarding_setup_usage_data', 'FrmOnboardingWizardController::setup_usage_data' );
235 -
236 220 // Addons.
237 221 add_action( 'wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
238 222 add_action( 'wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
239 223 add_action( 'wp_ajax_frm_activate_addon', 'FrmAddonsController::ajax_activate_addon' );
240 - add_action( 'wp_ajax_frm_deactivate_addon', 'FrmAddonsController::ajax_deactivate_addon' );
224 + add_action( 'wp_ajax_frm_connect', 'FrmAddonsController::connect_pro' );
241 225 add_action( 'wp_ajax_frm_install_addon', 'FrmAddonsController::ajax_install_addon' );
242 - add_action( 'wp_ajax_frm_uninstall_addon', 'FrmAddonsController::ajax_uninstall_addon' );
243 - // Plugin.
244 - add_action( 'wp_ajax_frm_install_plugin', 'FrmInstallPlugin::ajax_install_plugin' );
245 - add_action( 'wp_ajax_frm_check_plugin_activation', 'FrmInstallPlugin::ajax_check_plugin_activation' );
246 226
247 227 // Fields Controller.
248 228 add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
249 229 add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
@@ -271,9 +251,8 @@
271 251
272 252 // Form Templates Controller.
273 253 add_action( 'wp_ajax_frm_add_or_remove_favorite_template', 'FrmFormTemplatesController::ajax_add_or_remove_favorite' );
274 254 add_action( 'wp_ajax_frm_create_template', 'FrmFormTemplatesController::ajax_create_template' );
275 - add_action( 'wp_ajax_frm_get_free_templates', 'FrmFormTemplatesController::ajax_get_free_templates' );
276 255
277 256 // Inbox.
278 257 add_action( 'wp_ajax_frm_inbox_dismiss', 'FrmInboxController::dismiss_message' );
279 258
@@ -278,10 +257,8 @@
278 257 add_action( 'wp_ajax_frm_inbox_dismiss', 'FrmInboxController::dismiss_message' );
279 258
280 259 // Settings.
281 260 add_action( 'wp_ajax_frm_lite_settings_upgrade', 'FrmSettingsController::settings_cta_dismiss' );
282 - add_action( 'wp_ajax_frm_settings_tab', 'FrmSettingsController::load_settings_tab' );
283 - add_action( 'wp_ajax_frm_page_search', 'FrmSettingsController::page_search' );
284 261
285 262 // Styles Controller.
286 263 add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' );
287 264 add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' );
@@ -296,32 +273,14 @@
296 273 add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' );
297 274 add_action( 'wp_ajax_nopriv_frm_entries_csv', 'FrmXMLController::csv' );
298 275 add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
299 276
300 - // Dashboard Controller.
301 - add_action( 'wp_ajax_dashboard_ajax_action', 'FrmDashboardController::ajax_requests' );
277 + // Templates API.
278 + add_action( 'wp_ajax_template_api_signup', 'FrmFormTemplateApi::signup' );
302 279
303 280 // Submit with AJAX.
304 281 // Trigger before process_entry.
305 282 add_action( 'wp_loaded', 'FrmEntriesAJAXSubmitController::ajax_create', 5 );
306 -
307 - // Track the flows usage data.
308 - add_action( 'wp_ajax_frm_track_flows', 'FrmUsageController::ajax_track_flows' );
309 -
310 - // Applications.
311 - add_action( 'wp_ajax_frm_get_applications_data', 'FrmApplicationsController::get_applications_data' );
312 -
313 - // Reviews.
314 - add_action( 'wp_ajax_frm_dismiss_review', 'FrmAppController::dismiss_review' );
315 - add_action( 'wp_ajax_frm_small_screen_proceed', 'FrmAppController::small_screen_proceed' );
316 - add_action( 'wp_ajax_frm_sale_banner_dismiss', 'FrmSalesApi::dismiss_banner' );
317 -
318 - add_action( 'wp_ajax_frm_email_style_preview', 'FrmEmailStylesController::ajax_preview' );
319 - add_action( 'wp_ajax_frm_send_test_email', 'FrmEmailStylesController::ajax_send_test_email' );
320 -
321 - // Welcome Tour.
322 - add_action( 'wp_ajax_frm_mark_checklist_step_as_completed', 'FrmWelcomeTourController::ajax_mark_checklist_step_as_completed' );
323 - add_action( 'wp_ajax_frm_dismiss_welcome_tour', 'FrmWelcomeTourController::ajax_dismiss_welcome_tour' );
324 283 }
325 284
326 285 /**
327 286 * @return void
@@ -333,14 +292,12 @@
333 292 add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 );
334 293 add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
335 294
336 295 // Forms Controller.
337 - add_action( 'frm_form_classes', 'FrmFormsController::form_classes' );
296 + add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' );
338 297 add_filter( 'frm_submit_button_class', 'FrmFormsController::update_button_classes' );
339 298 add_filter( 'frm_back_button_class', 'FrmFormsController::update_button_classes' );
340 299
341 - add_filter( 'frm_pre_display_form', 'FrmSubmitHelper::copy_submit_field_settings_to_form' );
342 -
343 300 // Styles Controller.
344 301 add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
345 302 }
346 303
@@ -358,6 +315,16 @@
358 315 add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' );
359 316
360 317 // Drop tables when mu site is deleted.
361 318 add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
319 + }
320 +
321 + /**
322 + * @deprecated 5.0.06 use FrmElementorController::register_elementor_hooks directly.
323 + *
324 + * @return void
325 + */
326 + public static function register_elementor_hooks() {
327 + _deprecated_function( __FUNCTION__, '5.0.06', 'FrmElementorController::register_elementor_hooks' );
328 + FrmElementorController::register_elementor_hooks();
362 329 }
363 330 }