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