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