| @@ -121,10 +121,8 @@ | ||
| 121 | 121 | * core plugin. |
| 122 | 122 | */ |
| 123 | 123 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cf7-grid-layout-loader.php'; |
| 124 | 124 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wordpress-gurus-debug-api.php'; |
| 125 | - /** @since 5.0 dynamic tags interface */ | |
| 126 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cf7sg-dynamic-list.php'; | |
| 127 | 125 | |
| 128 | 126 | /** |
| 129 | 127 | * The class responsible for defining internationalization functionality |
| 130 | 128 | * of the plugin. |
| @@ -193,11 +191,11 @@ | ||
| 193 | 191 | //register dynamic dropdown taxonomy with cf7 post |
| 194 | 192 | $this->loader->add_action('init', $plugin_admin, 'register_dynamic_dropdown_taxonomy' , 20, 2 ); |
| 195 | 193 | //$this->loader->add_action('init', $plugin_admin, 'modify_cf7_post_type' , 20 ); |
| 196 | 194 | //add some metabox to the wpcf7_contact_form post type |
| 197 | - $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'edit_page_metabox' ); | |
| 198 | - /** @since 4.6.0 hide author metabox by default */ | |
| 199 | - $this->loader->add_filter('hidden_meta_boxes', $plugin_admin, 'hide_author_metabox',10,3); | |
| 195 | + $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'main_editor_meta_box' ); | |
| 196 | + $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'info_meta_box' ); | |
| 197 | + $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'helper_meta_box'); | |
| 200 | 198 | //save the post |
| 201 | 199 | $this->loader->add_action('save_post_wpcf7_contact_form', $plugin_admin, 'save_post', 10,3); |
| 202 | 200 | /** delete post @since 4.3.0 */ |
| 203 | 201 | $this->loader->add_action('before_delete_post', $plugin_admin, 'delete_post'); |
| @@ -214,11 +212,11 @@ | ||
| 214 | 212 | *@since 2.3.0 redirect post.php for form duplicate*/ |
| 215 | 213 | $this->loader->add_filter('admin_init', $plugin_admin, 'duplicate_cf7_form'); |
| 216 | 214 | /** @since 2.6.0*/ |
| 217 | 215 | $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'pretty_admin_pointers' ); |
| 218 | - $this->loader->add_action( 'cf7sg_plugin_pointers-edit-wpcf7_contact_form', $plugin_admin, 'edit_pointers',10,2 ); | |
| 216 | + $this->loader->add_action( 'cf7sg_plugin_pointers-edit-wpcf7_contact_form', $plugin_admin, 'edit_pointers' ); | |
| 219 | 217 | /** @since 3.0.0 */ |
| 220 | - $this->loader->add_action( 'cf7sg_plugin_pointers-wpcf7_contact_form', $plugin_admin, 'post_pointers',10,2 ); | |
| 218 | + $this->loader->add_action( 'cf7sg_plugin_pointers-wpcf7_contact_form', $plugin_admin, 'post_pointers' ); | |
| 221 | 219 | /* |
| 222 | 220 | CF7 Hooks |
| 223 | 221 | */ |
| 224 | 222 | //save cf7 form post |
| @@ -232,9 +230,9 @@ | ||
| 232 | 230 | $this->loader->add_filter( 'wpcf7_messages', $plugin_admin, 'disabled_message' , 5,2); |
| 233 | 231 | /** @since 3.0.0 */ |
| 234 | 232 | $this->loader->add_filter( 'wpcf7_map_meta_cap', $plugin_admin, 'reset_meta_cap' , 5,1); |
| 235 | 233 | //make sure users that cannot publish forms are set to pending. |
| 236 | - $this->loader->add_filter( 'wp_insert_post_data', $plugin_admin, 'pending_for_review',10,2); | |
| 234 | + $this->loader->add_filter( 'wp_insert_post_data', $plugin_admin, 'pending_for_review'); | |
| 237 | 235 | //add all form capabilities to editor role. |
| 238 | 236 | $this->loader->add_action( 'admin_init', $plugin_admin, 'enable_cf7_editor_role', 5,0 ); |
| 239 | 237 | /** @since 3.3.0 helper hooks added via action hook */ |
| 240 | 238 | $this->loader->add_action( 'cf7sg_ui_grid_helper_hooks', $plugin_admin, 'print_helper_hooks'); |
| @@ -251,18 +249,8 @@ | ||
| 251 | 249 | /** @since 4.3.0 enable previews/views of forms */ |
| 252 | 250 | $this->loader->add_action( 'init', $plugin_admin, 'register_form_preview_posttype', 0 ); |
| 253 | 251 | /** @since 4.4 load translation files */ |
| 254 | 252 | $this->loader->add_action( 'cf7pll_load_plugin_translation_resource', $plugin_admin, 'load_translation_files'); |
| 255 | - /** @since 4.11.0 build dynamic list tag generator */ | |
| 256 | - $this->loader->add_action( 'cf7sg_display_dynamic_list_tag_manager', $plugin_admin, 'print_dynamic_list_generator', 5, 4); | |
| 257 | - $this->loader->add_action( 'cf7sg_save_dynamic_list_form_classes', $plugin_admin, 'save_dynamic_list_form_classes', 5, 3); | |
| 258 | - $this->loader->add_action( 'cf7sg_dynamic_tag_manager_taxonomy_source', $plugin_admin, 'add_taxonomy_imagegrid_hook'); | |
| 259 | - // $this->loader->add_action( 'wpcf7_config_validator_validate', $plugin_admin, 'cf7_form_validation', 10, 1); | |
| 260 | - /** @since 4.12.5 trash bookeeping */ | |
| 261 | - $this->loader->add_action( 'trashed_post', $plugin_admin,'form_trashed'); | |
| 262 | - $this->loader->add_action( 'untrashed_post', $plugin_admin,'form_untrashed'); | |
| 263 | - /** @since 4.14.1 warn before update */ | |
| 264 | - $this->loader->add_action( 'after_plugin_row_cf7-grid-layout/cf7-grid-layout.php', $plugin_admin, 'enable_warning_on_plugin_update',9,3 ); | |
| 265 | 253 | } |
| 266 | 254 | |
| 267 | 255 | /** |
| 268 | 256 | * Register all of the hooks related to the public-facing functionality |
| @@ -275,9 +263,10 @@ | ||
| 275 | 263 | |
| 276 | 264 | $plugin_public = new Cf7_Grid_Layout_Public( $this->get_plugin_name(), $this->get_version() ); |
| 277 | 265 | |
| 278 | 266 | //register front-end scripts for CF7 forms |
| 279 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'register_styles_and_scripts',9,0 ); | |
| 267 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'register_styles' ); | |
| 268 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'register_scripts' ); | |
| 280 | 269 | $this->loader->add_action( 'wp_print_scripts', $plugin_public, 'dequeue_cf7_scripts',100 ); |
| 281 | 270 | $this->loader->add_action( 'wp_print_styles', $plugin_public, 'dequeue_cf7_styles',100 ); |
| 282 | 271 | $this->loader->add_filter( 'do_shortcode_tag', $plugin_public, 'cf7_shortcode_request',5,3 ); |
| 283 | 272 | |
| @@ -295,11 +284,9 @@ | ||
| 295 | 284 | $this->loader->add_action( 'wpcf7_init', $plugin_public, 'register_cf7_shortcode' ); |
| 296 | 285 | //setup individual tag filers |
| 297 | 286 | $this->loader->add_filter( 'wpcf7_posted_data', $plugin_public, 'setup_grid_values', 5, 1 ); |
| 298 | 287 | //filter cf7 validation |
| 299 | - $this->loader->add_action('wpcf7_swv_create_schema', $plugin_public, 'validate_swv_schemas', PHP_INT_MAX , 2); | |
| 300 | - | |
| 301 | - $this->loader->add_filter( 'wpcf7_validate', $plugin_public, 'filter_wpcf7_validate', 1, 1); | |
| 288 | + $this->loader->add_filter( 'wpcf7_validate', $plugin_public, 'filter_wpcf7_validate', 30, 2 ); | |
| 302 | 289 | //benchmark validation |
| 303 | 290 | $this->loader->add_filter( 'wpcf7_validate_dynamic_select*', $plugin_public, 'validate_required', 30, 2 ); |
| 304 | 291 | $this->loader->add_filter( 'wpcf7_validate_benchmark*', $plugin_public, 'validate_required', 30, 2 ); |
| 305 | 292 | /** |
| @@ -312,21 +299,15 @@ | ||
| 312 | 299 | $this->loader->add_filter( 'cf7_2_post_form_values', $plugin_public, 'load_saved_toggled_status' ); |
| 313 | 300 | /** track toggles |
| 314 | 301 | *@since 1.1.0 */ |
| 315 | 302 | $this->loader->add_action('cf7_2_post_form_posted', $plugin_public, 'save_toggle_status', 10, 5 ); |
| 316 | - /** @since 2.4.1 attach array file fields to mails */ | |
| 303 | + /** @since 2.4.1 attache array file fields to mails */ | |
| 317 | 304 | $this->loader->add_filter( 'wpcf7_mail_components', $plugin_public, 'wpcf7_mail_components' , 999,3); |
| 318 | 305 | /** @since 4.0.0 enable/disable autop with filter */ |
| 319 | 306 | $this->loader->add_filter( 'wpcf7_autop_or_not', $plugin_public, 'disable_autop_for_grid' ,5,1); |
| 320 | 307 | /** @since 4.4 prefill preview forms */ |
| 321 | - $this->loader->add_action( 'wpcf7_before_send_mail', $plugin_public, 'on_submit_success'); | |
| 322 | - /** @since 4.11.0 abstract out dynamic lsits*/ | |
| 323 | - $this->loader->add_action( 'cf7sg_dynamic_select_html_field', $plugin_public, 'build_dynamic_select_field',5,5); | |
| 324 | - $this->loader->add_action( 'cf7sg_dynamic_checkbox_html_field', $plugin_public, 'build_dynamic_checkbox_field',5,5); | |
| 325 | - $this->loader->add_action( 'smart_grid_register_styles', $plugin_public,'register_dynamic_list_styles',10,2); | |
| 326 | - $this->loader->add_action( 'smart_grid_register_scripts', $plugin_public,'register_dynamic_list_scripts',10,2); | |
| 327 | - /** @since 4.11.0 enable custom submission messages using HTML.*/ | |
| 328 | - $this->loader->add_action('wpcf7_mail_sent', $plugin_public, 'change_submission_msg'); | |
| 308 | + $this->loader->add_action( 'wpcf7_before_send_mail', $plugin_public, 'prefill_preview_forms'); | |
| 309 | + | |
| 329 | 310 | } |
| 330 | 311 | |
| 331 | 312 | /** |
| 332 | 313 | * Run the loader to execute all of the hooks with WordPress. |