PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.8
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.8
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 +29 -53 6.256.8 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
@@ -167,9 +164,11 @@
167 164
168 165 // Settings Controller.
169 166 add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
170 167 add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
171 - add_action( 'frm_after_settings_tabs', 'FrmSettingsController::settings_cta' );
168 + add_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' );
169 + add_action( 'wp_ajax_frm_settings_tab', 'FrmSettingsController::load_settings_tab' );
170 + add_action( 'wp_ajax_frm_page_search', 'FrmSettingsController::page_search' );
172 171
173 172 // Styles Controller.
174 173 add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
175 174 add_action( 'plugins_loaded', 'FrmStylesController::plugins_loaded' );
@@ -188,8 +187,9 @@
188 187 // Applications Controller.
189 188 // Use the same priority as styles so Applications appear directly under Styles.
190 189 add_action( 'admin_menu', 'FrmApplicationsController::menu', 14 );
191 190 add_action( 'admin_enqueue_scripts', 'FrmApplicationsController::dequeue_scripts', 15 );
191 + add_action( 'wp_ajax_frm_get_applications_data', 'FrmApplicationsController::get_applications_data' );
192 192
193 193 // CAPTCHA
194 194 add_filter( 'frm_setup_edit_field_vars', 'FrmFieldCaptcha::update_field_name' );
195 195
@@ -198,22 +198,12 @@
198 198
199 199 // Cronjob.
200 200 add_action( 'admin_init', 'FrmCronController::schedule_events' );
201 201
202 - // Deactivation feedback.
203 - add_action( 'admin_enqueue_scripts', 'FrmDeactivationFeedbackController::enqueue_assets' );
204 - add_action( 'admin_footer', 'FrmDeactivationFeedbackController::footer_html' );
205 - add_action( 'deactivated_plugin', 'FrmDeactivationFeedbackController::set_feedback_expired_date' );
206 -
207 - add_action( 'frm_email_styles_extra_settings', 'FrmEmailStylesController::show_upsell_settings' );
208 -
209 202 FrmDashboardController::load_admin_hooks();
210 203 FrmTransLiteHooksController::load_admin_hooks();
211 204 FrmStrpLiteHooksController::load_admin_hooks();
212 - FrmSquareLiteHooksController::load_admin_hooks();
213 205 FrmSMTPController::load_hooks();
214 - FrmOnboardingWizardController::load_admin_hooks();
215 - FrmAddonsController::load_admin_hooks();
216 206 new FrmPluginSearch();
217 207 }
218 208
219 209 /**
@@ -223,22 +213,16 @@
223 213 add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' );
224 214 add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
225 215 add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
226 216
227 - // Onboarding Wizard Controller.
228 - add_action( 'wp_ajax_frm_onboarding_consent_tracking', 'FrmOnboardingWizardController::ajax_consent_tracking' );
229 - add_action( 'wp_ajax_frm_onboarding_setup_usage_data', 'FrmOnboardingWizardController::setup_usage_data' );
230 -
231 217 // Addons.
232 218 add_action( 'wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
233 219 add_action( 'wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
234 220 add_action( 'wp_ajax_frm_activate_addon', 'FrmAddonsController::ajax_activate_addon' );
235 221 add_action( 'wp_ajax_frm_deactivate_addon', 'FrmAddonsController::ajax_deactivate_addon' );
222 + add_action( 'wp_ajax_frm_connect', 'FrmAddonsController::connect_pro' );
236 223 add_action( 'wp_ajax_frm_install_addon', 'FrmAddonsController::ajax_install_addon' );
237 224 add_action( 'wp_ajax_frm_uninstall_addon', 'FrmAddonsController::ajax_uninstall_addon' );
238 - // Plugin.
239 - add_action( 'wp_ajax_frm_install_plugin', 'FrmInstallPlugin::ajax_install_plugin' );
240 - add_action( 'wp_ajax_frm_check_plugin_activation', 'FrmInstallPlugin::ajax_check_plugin_activation' );
241 225
242 226 // Fields Controller.
243 227 add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
244 228 add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
@@ -266,9 +250,8 @@
266 250
267 251 // Form Templates Controller.
268 252 add_action( 'wp_ajax_frm_add_or_remove_favorite_template', 'FrmFormTemplatesController::ajax_add_or_remove_favorite' );
269 253 add_action( 'wp_ajax_frm_create_template', 'FrmFormTemplatesController::ajax_create_template' );
270 - add_action( 'wp_ajax_frm_get_free_templates', 'FrmFormTemplatesController::ajax_get_free_templates' );
271 254
272 255 // Inbox.
273 256 add_action( 'wp_ajax_frm_inbox_dismiss', 'FrmInboxController::dismiss_message' );
274 257
@@ -273,10 +256,8 @@
273 256 add_action( 'wp_ajax_frm_inbox_dismiss', 'FrmInboxController::dismiss_message' );
274 257
275 258 // Settings.
276 259 add_action( 'wp_ajax_frm_lite_settings_upgrade', 'FrmSettingsController::settings_cta_dismiss' );
277 - add_action( 'wp_ajax_frm_settings_tab', 'FrmSettingsController::load_settings_tab' );
278 - add_action( 'wp_ajax_frm_page_search', 'FrmSettingsController::page_search' );
279 260
280 261 // Styles Controller.
281 262 add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' );
282 263 add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' );
@@ -291,8 +272,11 @@
291 272 add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' );
292 273 add_action( 'wp_ajax_nopriv_frm_entries_csv', 'FrmXMLController::csv' );
293 274 add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
294 275
276 + // Templates API.
277 + add_action( 'wp_ajax_template_api_signup', 'FrmFormTemplateApi::signup' );
278 +
295 279 // Dashboard Controller.
296 280 add_action( 'wp_ajax_dashboard_ajax_action', 'FrmDashboardController::ajax_requests' );
297 281
298 282 // Submit with AJAX.
@@ -297,24 +281,8 @@
297 281
298 282 // Submit with AJAX.
299 283 // Trigger before process_entry.
300 284 add_action( 'wp_loaded', 'FrmEntriesAJAXSubmitController::ajax_create', 5 );
301 -
302 - // Track the flows usage data.
303 - add_action( 'wp_ajax_frm_track_flows', 'FrmUsageController::ajax_track_flows' );
304 -
305 - // Applications.
306 - add_action( 'wp_ajax_frm_get_applications_data', 'FrmApplicationsController::get_applications_data' );
307 -
308 - // Reviews.
309 - add_action( 'wp_ajax_frm_dismiss_review', 'FrmAppController::dismiss_review' );
310 -
311 - add_action( 'wp_ajax_frm_small_screen_proceed', 'FrmAppController::small_screen_proceed' );
312 -
313 - add_action( 'wp_ajax_frm_sale_banner_dismiss', 'FrmSalesApi::dismiss_banner' );
314 -
315 - add_action( 'wp_ajax_frm_email_style_preview', 'FrmEmailStylesController::ajax_preview' );
316 - add_action( 'wp_ajax_frm_send_test_email', 'FrmEmailStylesController::ajax_send_test_email' );
317 285 }
318 286
319 287 /**
320 288 * @return void
@@ -326,14 +294,12 @@
326 294 add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 );
327 295 add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
328 296
329 297 // Forms Controller.
330 - add_action( 'frm_form_classes', 'FrmFormsController::form_classes' );
298 + add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' );
331 299 add_filter( 'frm_submit_button_class', 'FrmFormsController::update_button_classes' );
332 300 add_filter( 'frm_back_button_class', 'FrmFormsController::update_button_classes' );
333 301
334 - add_filter( 'frm_pre_display_form', 'FrmSubmitHelper::copy_submit_field_settings_to_form' );
335 -
336 302 // Styles Controller.
337 303 add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
338 304 }
339 305
@@ -351,6 +317,16 @@
351 317 add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' );
352 318
353 319 // Drop tables when mu site is deleted.
354 320 add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
321 + }
322 +
323 + /**
324 + * @deprecated 5.0.06 use FrmElementorController::register_elementor_hooks directly.
325 + *
326 + * @return void
327 + */
328 + public static function register_elementor_hooks() {
329 + _deprecated_function( __FUNCTION__, '5.0.06', 'FrmElementorController::register_elementor_hooks' );
330 + FrmElementorController::register_elementor_hooks();
355 331 }
356 332 }