PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.0
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.0
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 +3 -71 6.55.0 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' );
@@ -101,34 +89,24 @@
101 89 * Make name field work with View.
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 -
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 );
109 -
110 - FrmTransLiteHooksController::load_hooks();
111 - FrmStrpLiteHooksController::load_hooks();
112 93 }
113 94
114 - /**
115 - * @return void
116 - */
117 95 public static function load_admin_hooks() {
118 96 add_action( 'admin_menu', 'FrmAppController::menu', 1 );
119 97 add_filter( 'admin_body_class', 'FrmAppController::add_admin_class', 999 );
98 + add_action( 'admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style' );
120 99 add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' );
121 100 add_action( 'admin_init', 'FrmAppController::admin_init', 11 );
122 - add_action( 'admin_enqueue_scripts', 'FrmAppController::admin_enqueue_scripts' );
123 101 add_filter( 'plugin_action_links_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::settings_link' );
124 102 add_filter( 'admin_footer_text', 'FrmAppController::set_footer_text' );
125 - add_action( 'admin_footer', 'FrmAppController::add_admin_footer_links' );
126 103 add_action( 'wp_ajax_frm_dismiss_review', 'FrmAppController::dismiss_review' );
127 104
128 105 // Addons Controller.
129 106 add_action( 'admin_menu', 'FrmAddonsController::menu', 100 );
130 107 add_filter( 'pre_set_site_transient_update_plugins', 'FrmAddonsController::check_update' );
108 + add_action( 'frm_page_footer', 'FrmAppHelper::renewal_message' );
131 109
132 110 // Entries Controller.
133 111 add_action( 'admin_menu', 'FrmEntriesController::menu', 12 );
134 112 add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 );
@@ -148,12 +126,8 @@
148 126 add_action( 'frm_after_field_options', 'FrmFormsController::logic_tip' );
149 127
150 128 add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 );
151 129 add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' );
152 -
153 - // Elementor.
154 - add_action( 'elementor/editor/footer', 'FrmElementorController::admin_init' );
155 -
156 130 add_action( 'media_buttons', 'FrmFormsController::insert_form_button' );
157 131 add_action( 'et_pb_admin_excluded_shortcodes', 'FrmFormsController::prevent_divi_conflict' );
158 132
159 133 // Forms Model.
@@ -170,11 +144,9 @@
170 144 add_action( 'wp_ajax_frm_page_search', 'FrmSettingsController::page_search' );
171 145
172 146 // Styles Controller.
173 147 add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
174 - add_action( 'plugins_loaded', 'FrmStylesController::plugins_loaded' );
175 148 add_action( 'admin_init', 'FrmStylesController::admin_init' );
176 - 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.
177 149
178 150 // XML Controller.
179 151 add_action( 'admin_menu', 'FrmXMLController::menu', 41 );
180 152
@@ -182,26 +154,13 @@
182 154 add_action( 'enqueue_block_editor_assets', 'FrmSimpleBlocksController::block_editor_assets' );
183 155
184 156 add_action( 'admin_init', 'FrmUsageController::schedule_send' );
185 157
186 - // Applications Controller.
187 - add_action( 'admin_menu', 'FrmApplicationsController::menu', 14 ); // Use the same priority as styles so Applications appear directly under Styles.
188 - add_action( 'admin_enqueue_scripts', 'FrmApplicationsController::dequeue_scripts', 15 );
189 - add_action( 'wp_ajax_frm_get_applications_data', 'FrmApplicationsController::get_applications_data' );
190 -
191 - // CAPTCHA
192 - add_filter( 'frm_setup_edit_field_vars', 'FrmFieldCaptcha::update_field_name' );
193 -
194 - FrmTransLiteHooksController::load_admin_hooks();
195 - FrmStrpLiteHooksController::load_admin_hooks();
196 158 FrmSMTPController::load_hooks();
197 159 FrmWelcomeController::load_hooks();
198 160 new FrmPluginSearch();
199 161 }
200 162
201 - /**
202 - * @return void
203 - */
204 163 public static function load_ajax_hooks() {
205 164 add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' );
206 165 add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
207 166 add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
@@ -232,10 +191,8 @@
232 191 add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' );
233 192 add_action( 'wp_ajax_frm_forms_trash', 'FrmFormsController::ajax_trash' );
234 193 add_action( 'wp_ajax_frm_install_form', 'FrmFormsController::build_new_form' );
235 194 add_action( 'wp_ajax_frm_build_template', 'FrmFormsController::build_template' );
236 - add_action( 'wp_ajax_frm_create_page_with_shortcode', 'FrmFormsController::create_page_with_shortcode' );
237 - add_action( 'wp_ajax_get_page_dropdown', 'FrmFormsController::get_page_dropdown' );
238 195
239 196 add_action( 'wp_ajax_frm_dismiss_migrator', 'FrmFormMigratorsHelper::dismiss_migrator' );
240 197
241 198 // Inbox.
@@ -250,9 +207,8 @@
250 207 add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' );
251 208 add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' );
252 209 add_action( 'wp_ajax_frmpro_css', 'FrmStylesController::load_saved_css' );
253 210 add_action( 'wp_ajax_nopriv_frmpro_css', 'FrmStylesController::load_saved_css' );
254 - add_action( 'wp_ajax_frm_rename_style', 'FrmStylesController::rename_style' );
255 211
256 212 // XML Controller.
257 213 add_action( 'wp_ajax_frm_install_template', 'FrmXMLController::install_template' );
258 214 add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' );
@@ -260,16 +216,10 @@
260 216 add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' );
261 217
262 218 // Templates API.
263 219 add_action( 'wp_ajax_template_api_signup', 'FrmFormTemplateApi::signup' );
264 -
265 - // Submit with AJAX.
266 - add_action( 'wp_loaded', 'FrmEntriesAJAXSubmitController::ajax_create', 5 ); // Trigger before process_entry.
267 220 }
268 221
269 - /**
270 - * @return void
271 - */
272 222 public static function load_form_hooks() {
273 223 // Fields Controller.
274 224 add_filter( 'frm_field_type', 'FrmFieldsController::change_type' );
275 225 add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' );
@@ -277,38 +227,20 @@
277 227 add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' );
278 228
279 229 // Forms Controller.
280 230 add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' );
281 - add_filter( 'frm_submit_button_class', 'FrmFormsController::update_button_classes' );
282 - add_filter( 'frm_back_button_class', 'FrmFormsController::update_button_classes' );
283 231
284 232 // Styles Controller.
285 233 add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 );
286 234 }
287 235
288 - /**
289 - * @return void
290 - */
291 236 public static function load_view_hooks() {
292 237 // Hooks go here when a view is loaded.
293 238 }
294 239
295 - /**
296 - * @return void
297 - */
298 240 public static function load_multisite_hooks() {
299 241 add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' );
300 242
301 243 // Drop tables when mu site is deleted.
302 244 add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' );
303 - }
304 -
305 - /**
306 - * @deprecated 5.0.06 use FrmElementorController::register_elementor_hooks directly.
307 - *
308 - * @return void
309 - */
310 - public static function register_elementor_hooks() {
311 - _deprecated_function( __FUNCTION__, '5.0.06', 'FrmElementorController::register_elementor_hooks' );
312 - FrmElementorController::register_elementor_hooks();
313 245 }
314 246 }