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 -64 6.256.7 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,19 +161,23 @@
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' );
176 178 add_action( 'admin_init', 'FrmStylesController::admin_init' );
177 - // Use 11 so it happens after add_action( 'wp_default_styles', 'wp_default_styles' ); where edit.css is added.
178 - 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.
179 180
180 181 // XML Controller.
181 182 add_action( 'admin_menu', 'FrmXMLController::menu', 41 );
182 183
@@ -185,11 +186,11 @@
185 186
186 187 add_action( 'admin_init', 'FrmUsageController::schedule_send' );
187 188
188 189 // Applications Controller.
189 - // Use the same priority as styles so Applications appear directly under Styles.
190 - 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.
191 191 add_action( 'admin_enqueue_scripts', 'FrmApplicationsController::dequeue_scripts', 15 );
192 + add_action( 'wp_ajax_frm_get_applications_data', 'FrmApplicationsController::get_applications_data' );
192 193
193 194 // CAPTCHA
194 195 add_filter( 'frm_setup_edit_field_vars', 'FrmFieldCaptcha::update_field_name' );
195 196
@@ -198,22 +199,12 @@
198 199
199 200 // Cronjob.
200 201 add_action( 'admin_init', 'FrmCronController::schedule_events' );
201 202
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 - 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();
206 + FrmWelcomeController::load_hooks();
216 207 new FrmPluginSearch();
217 208 }
218 209
219 210 /**
@@ -223,22 +214,14 @@
223 214 add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' );
224 215 add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
225 216 add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
226 217
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 218 // Addons.
232 219 add_action( 'wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
233 220 add_action( 'wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
234 221 add_action( 'wp_ajax_frm_activate_addon', 'FrmAddonsController::ajax_activate_addon' );
235 - 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 - 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 224
242 225 // Fields Controller.
243 226 add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
244 227 add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
@@ -266,9 +249,8 @@
266 249
267 250 // Form Templates Controller.
268 251 add_action( 'wp_ajax_frm_add_or_remove_favorite_template', 'FrmFormTemplatesController::ajax_add_or_remove_favorite' );
269 252 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 253
272 254 // Inbox.
273 255 add_action( 'wp_ajax_frm_inbox_dismiss', 'FrmInboxController::dismiss_message' );
274 256
@@ -273,10 +255,8 @@
273 255 add_action( 'wp_ajax_frm_inbox_dismiss', 'FrmInboxController::dismiss_message' );
274 256
275 257 // Settings.
276 258 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 259
280 260 // Styles Controller.
281 261 add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' );
282 262 add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' );
@@ -291,30 +271,13 @@
291 271 add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' );
292 272 add_action( 'wp_ajax_nopriv_frm_entries_csv', 'FrmXMLController::csv' );
293 273 add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
294 274
295 - // Dashboard Controller.
296 - add_action( 'wp_ajax_dashboard_ajax_action', 'FrmDashboardController::ajax_requests' );
275 + // Templates API.
276 + add_action( 'wp_ajax_template_api_signup', 'FrmFormTemplateApi::signup' );
297 277
298 278 // Submit with AJAX.
299 - // Trigger before process_entry.
300 - 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' );
279 + add_action( 'wp_loaded', 'FrmEntriesAJAXSubmitController::ajax_create', 5 ); // Trigger before process_entry.
317 280 }
318 281
319 282 /**
320 283 * @return void
@@ -326,14 +289,12 @@
326 289 add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 );
327 290 add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
328 291
329 292 // Forms Controller.
330 - add_action( 'frm_form_classes', 'FrmFormsController::form_classes' );
293 + add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' );
331 294 add_filter( 'frm_submit_button_class', 'FrmFormsController::update_button_classes' );
332 295 add_filter( 'frm_back_button_class', 'FrmFormsController::update_button_classes' );
333 296
334 - add_filter( 'frm_pre_display_form', 'FrmSubmitHelper::copy_submit_field_settings_to_form' );
335 -
336 297 // Styles Controller.
337 298 add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
338 299 }
339 300
@@ -351,6 +312,16 @@
351 312 add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' );
352 313
353 314 // Drop tables when mu site is deleted.
354 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();
355 326 }
356 327 }