@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class FrmStylesController { |
| 4 | - public static $post_type = 'frm_styles'; |
|
| 5 | - public static $screen = 'formidable_page_formidable-styles'; |
|
| 6 | - |
|
| 7 | - public static function load_pro_hooks() { |
|
| 8 | - if ( FrmAppHelper::pro_is_installed() ) { |
|
| 9 | - FrmProStylesController::load_pro_hooks(); |
|
| 10 | - } |
|
| 11 | - } |
|
| 12 | - |
|
| 13 | - public static function register_post_types() { |
|
| 14 | - register_post_type( self::$post_type, array( |
|
| 15 | - 'label' => __( 'Styles', 'formidable' ), |
|
| 16 | - 'public' => false, |
|
| 17 | - 'show_ui' => false, |
|
| 18 | - 'capability_type' => 'page', |
|
| 4 | + public static $post_type = 'frm_styles'; |
|
| 5 | + public static $screen = 'formidable_page_formidable-styles'; |
|
| 6 | + |
|
| 7 | + public static function load_pro_hooks() { |
|
| 8 | + if ( FrmAppHelper::pro_is_installed() ) { |
|
| 9 | + FrmProStylesController::load_pro_hooks(); |
|
| 10 | + } |
|
| 11 | + } |
|
| 12 | + |
|
| 13 | + public static function register_post_types() { |
|
| 14 | + register_post_type( self::$post_type, array( |
|
| 15 | + 'label' => __( 'Styles', 'formidable' ), |
|
| 16 | + 'public' => false, |
|
| 17 | + 'show_ui' => false, |
|
| 18 | + 'capability_type' => 'page', |
|
| 19 | 19 | 'capabilities' => array( |
| 20 | 20 | 'edit_post' => 'frm_change_settings', |
| 21 | 21 | 'edit_posts' => 'frm_change_settings', |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | 'delete_posts' => 'frm_change_settings', |
| 26 | 26 | 'read_private_posts' => 'read_private_posts', |
| 27 | 27 | ), |
| 28 | - 'supports' => array( |
|
| 28 | + 'supports' => array( |
|
| 29 | 29 | 'title', |
| 30 | - ), |
|
| 31 | - 'has_archive' => false, |
|
| 32 | - 'labels' => array( |
|
| 30 | + ), |
|
| 31 | + 'has_archive' => false, |
|
| 32 | + 'labels' => array( |
|
| 33 | 33 | 'name' => __( 'Styles', 'formidable' ), |
| 34 | 34 | 'singular_name' => __( 'Style', 'formidable' ), |
| 35 | 35 | 'menu_name' => __( 'Style', 'formidable' ), |
@@ -37,19 +37,19 @@ discard block |
||
| 37 | 37 | 'add_new_item' => __( 'Create a New Style', 'formidable' ), |
| 38 | 38 | 'edit_item' => __( 'Edit Style', 'formidable' ), |
| 39 | 39 | ), |
| 40 | - ) ); |
|
| 41 | - } |
|
| 40 | + ) ); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public static function menu() { |
|
| 43 | + public static function menu() { |
|
| 44 | 44 | add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' ); |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | 47 | public static function admin_init() { |
| 48 | 48 | if ( ! FrmAppHelper::is_admin_page( 'formidable-styles' ) ) { |
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - self::load_pro_hooks(); |
|
| 52 | + self::load_pro_hooks(); |
|
| 53 | 53 | |
| 54 | 54 | $style_tab = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' ); |
| 55 | 55 | if ( $style_tab == 'manage' || $style_tab == 'custom_css' ) { |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | wp_enqueue_style( 'frm-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_css' ) ); |
| 63 | 63 | |
| 64 | 64 | $style = apply_filters( 'frm_style_head', false ); |
| 65 | - if ( $style ) { |
|
| 65 | + if ( $style ) { |
|
| 66 | 66 | wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) . '&' . http_build_query( $style->post_content ) ); |
| 67 | - } |
|
| 68 | - } |
|
| 67 | + } |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | 70 | public static function enqueue_css( $register = 'enqueue' ) { |
| 71 | 71 | global $frm_vars; |
@@ -222,10 +222,10 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | public static function load_styler( $style, $message = '' ) { |
| 225 | - global $frm_settings; |
|
| 225 | + global $frm_settings; |
|
| 226 | 226 | |
| 227 | - $frm_style = new FrmStyle(); |
|
| 228 | - $styles = $frm_style->get_all(); |
|
| 227 | + $frm_style = new FrmStyle(); |
|
| 228 | + $styles = $frm_style->get_all(); |
|
| 229 | 229 | |
| 230 | 230 | if ( is_numeric( $style ) ) { |
| 231 | 231 | $style = $styles[ $style ]; |
@@ -233,10 +233,10 @@ discard block |
||
| 233 | 233 | $style = $frm_style->get_default_style( $styles ); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - self::add_meta_boxes(); |
|
| 236 | + self::add_meta_boxes(); |
|
| 237 | 237 | |
| 238 | 238 | include( FrmAppHelper::plugin_path() . '/classes/views/styles/show.php' ); |
| 239 | - } |
|
| 239 | + } |
|
| 240 | 240 | |
| 241 | 241 | /** |
| 242 | 242 | * @param string $message |
@@ -254,31 +254,31 @@ discard block |
||
| 254 | 254 | include( FrmAppHelper::plugin_path() . '/classes/views/styles/manage.php' ); |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - private static function manage_styles() { |
|
| 257 | + private static function manage_styles() { |
|
| 258 | 258 | $style_nonce = FrmAppHelper::get_post_param( 'frm_manage_style', '', 'sanitize_text_field' ); |
| 259 | 259 | if ( ! $_POST || ! isset( $_POST['style'] ) || ! wp_verify_nonce( $style_nonce, 'frm_manage_style_nonce' ) ) { |
| 260 | - return self::manage(); |
|
| 261 | - } |
|
| 260 | + return self::manage(); |
|
| 261 | + } |
|
| 262 | 262 | |
| 263 | - global $wpdb; |
|
| 263 | + global $wpdb; |
|
| 264 | 264 | |
| 265 | 265 | $forms = FrmForm::get_published_forms(); |
| 266 | - foreach ( $forms as $form ) { |
|
| 267 | - if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) { |
|
| 268 | - continue; |
|
| 269 | - } |
|
| 266 | + foreach ( $forms as $form ) { |
|
| 267 | + if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) { |
|
| 268 | + continue; |
|
| 269 | + } |
|
| 270 | 270 | |
| 271 | - $form->options['custom_style'] = $_POST['style'][ $form->id ]; |
|
| 271 | + $form->options['custom_style'] = $_POST['style'][ $form->id ]; |
|
| 272 | 272 | |
| 273 | 273 | $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) ); |
| 274 | 274 | unset( $form ); |
| 275 | - } |
|
| 275 | + } |
|
| 276 | 276 | |
| 277 | - $message = __( 'Your form styles have been saved.', 'formidable' ); |
|
| 277 | + $message = __( 'Your form styles have been saved.', 'formidable' ); |
|
| 278 | 278 | return self::manage( $message, $forms ); |
| 279 | - } |
|
| 279 | + } |
|
| 280 | 280 | |
| 281 | - public static function custom_css( $message = '', $style = null ) { |
|
| 281 | + public static function custom_css( $message = '', $style = null ) { |
|
| 282 | 282 | if ( function_exists( 'wp_enqueue_code_editor' ) ) { |
| 283 | 283 | $id = 'frm_codemirror_box'; |
| 284 | 284 | $settings = wp_enqueue_code_editor( array( |
@@ -318,41 +318,41 @@ discard block |
||
| 318 | 318 | return self::custom_css( $message ); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | - public static function route() { |
|
| 321 | + public static function route() { |
|
| 322 | 322 | $action = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' ); |
| 323 | 323 | |
| 324 | - switch ( $action ) { |
|
| 325 | - case 'edit': |
|
| 326 | - case 'save': |
|
| 327 | - case 'manage': |
|
| 328 | - case 'manage_styles': |
|
| 329 | - case 'custom_css': |
|
| 330 | - case 'save_css': |
|
| 324 | + switch ( $action ) { |
|
| 325 | + case 'edit': |
|
| 326 | + case 'save': |
|
| 327 | + case 'manage': |
|
| 328 | + case 'manage_styles': |
|
| 329 | + case 'custom_css': |
|
| 330 | + case 'save_css': |
|
| 331 | 331 | return self::$action(); |
| 332 | - default: |
|
| 333 | - do_action( 'frm_style_action_route', $action ); |
|
| 334 | - if ( apply_filters( 'frm_style_stop_action_route', false, $action ) ) { |
|
| 335 | - return; |
|
| 336 | - } |
|
| 332 | + default: |
|
| 333 | + do_action( 'frm_style_action_route', $action ); |
|
| 334 | + if ( apply_filters( 'frm_style_stop_action_route', false, $action ) ) { |
|
| 335 | + return; |
|
| 336 | + } |
|
| 337 | 337 | |
| 338 | - if ( 'new_style' == $action || 'duplicate' == $action ) { |
|
| 339 | - return self::$action(); |
|
| 340 | - } |
|
| 338 | + if ( 'new_style' == $action || 'duplicate' == $action ) { |
|
| 339 | + return self::$action(); |
|
| 340 | + } |
|
| 341 | 341 | |
| 342 | - return self::edit(); |
|
| 343 | - } |
|
| 344 | - } |
|
| 342 | + return self::edit(); |
|
| 343 | + } |
|
| 344 | + } |
|
| 345 | 345 | |
| 346 | - public static function reset_styling() { |
|
| 346 | + public static function reset_styling() { |
|
| 347 | 347 | FrmAppHelper::permission_check( 'frm_change_settings' ); |
| 348 | - check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 348 | + check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 349 | 349 | |
| 350 | - $frm_style = new FrmStyle(); |
|
| 351 | - $defaults = $frm_style->get_defaults(); |
|
| 350 | + $frm_style = new FrmStyle(); |
|
| 351 | + $defaults = $frm_style->get_defaults(); |
|
| 352 | 352 | |
| 353 | - echo json_encode( $defaults ); |
|
| 354 | - wp_die(); |
|
| 355 | - } |
|
| 353 | + echo json_encode( $defaults ); |
|
| 354 | + wp_die(); |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | 357 | public static function change_styling() { |
| 358 | 358 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
@@ -367,21 +367,21 @@ discard block |
||
| 367 | 367 | wp_die(); |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - private static function add_meta_boxes() { |
|
| 371 | - |
|
| 372 | - // setup meta boxes |
|
| 373 | - $meta_boxes = array( |
|
| 374 | - 'general' => __( 'General', 'formidable' ), |
|
| 375 | - 'form-title' => __( 'Form Title', 'formidable' ), |
|
| 376 | - 'form-description' => __( 'Form Description', 'formidable' ), |
|
| 377 | - 'field-labels' => __( 'Field Labels', 'formidable' ), |
|
| 378 | - 'field-description' => __( 'Field Description', 'formidable' ), |
|
| 379 | - 'field-colors' => __( 'Field Colors', 'formidable' ), |
|
| 380 | - 'field-sizes' => __( 'Field Settings', 'formidable' ), |
|
| 381 | - 'check-box-radio-fields' => __( 'Check Box & Radio Fields', 'formidable' ), |
|
| 382 | - 'buttons' => __( 'Buttons', 'formidable' ), |
|
| 383 | - 'form-messages' => __( 'Form Messages', 'formidable' ), |
|
| 384 | - ); |
|
| 370 | + private static function add_meta_boxes() { |
|
| 371 | + |
|
| 372 | + // setup meta boxes |
|
| 373 | + $meta_boxes = array( |
|
| 374 | + 'general' => __( 'General', 'formidable' ), |
|
| 375 | + 'form-title' => __( 'Form Title', 'formidable' ), |
|
| 376 | + 'form-description' => __( 'Form Description', 'formidable' ), |
|
| 377 | + 'field-labels' => __( 'Field Labels', 'formidable' ), |
|
| 378 | + 'field-description' => __( 'Field Description', 'formidable' ), |
|
| 379 | + 'field-colors' => __( 'Field Colors', 'formidable' ), |
|
| 380 | + 'field-sizes' => __( 'Field Settings', 'formidable' ), |
|
| 381 | + 'check-box-radio-fields' => __( 'Check Box & Radio Fields', 'formidable' ), |
|
| 382 | + 'buttons' => __( 'Buttons', 'formidable' ), |
|
| 383 | + 'form-messages' => __( 'Form Messages', 'formidable' ), |
|
| 384 | + ); |
|
| 385 | 385 | |
| 386 | 386 | /** |
| 387 | 387 | * Add custom boxes to the styling settings |
@@ -413,18 +413,18 @@ discard block |
||
| 413 | 413 | $file_name = apply_filters( 'frm_style_settings_' . $sec['args'], $file_name ); |
| 414 | 414 | |
| 415 | 415 | include( $file_name ); |
| 416 | - } |
|
| 416 | + } |
|
| 417 | 417 | |
| 418 | - public static function load_css() { |
|
| 418 | + public static function load_css() { |
|
| 419 | 419 | header( 'Content-type: text/css' ); |
| 420 | 420 | |
| 421 | - $frm_style = new FrmStyle(); |
|
| 422 | - $defaults = $frm_style->get_defaults(); |
|
| 421 | + $frm_style = new FrmStyle(); |
|
| 422 | + $defaults = $frm_style->get_defaults(); |
|
| 423 | 423 | $style = ''; |
| 424 | 424 | |
| 425 | 425 | include( FrmAppHelper::plugin_path() . '/css/_single_theme.css.php' ); |
| 426 | - wp_die(); |
|
| 427 | - } |
|
| 426 | + wp_die(); |
|
| 427 | + } |
|
| 428 | 428 | |
| 429 | 429 | public static function load_saved_css() { |
| 430 | 430 | $css = get_transient( 'frmpro_css' ); |
@@ -433,49 +433,49 @@ discard block |
||
| 433 | 433 | wp_die(); |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | - /** |
|
| 437 | - * Check if the Formidable styling should be loaded, |
|
| 438 | - * then enqueue it for the footer |
|
| 439 | - * @since 2.0 |
|
| 440 | - */ |
|
| 441 | - public static function enqueue_style() { |
|
| 442 | - global $frm_vars; |
|
| 443 | - |
|
| 444 | - if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) { |
|
| 445 | - // the CSS has already been loaded |
|
| 446 | - return; |
|
| 447 | - } |
|
| 448 | - |
|
| 449 | - $frm_settings = FrmAppHelper::get_settings(); |
|
| 450 | - if ( $frm_settings->load_style != 'none' ) { |
|
| 451 | - wp_enqueue_style( 'formidable' ); |
|
| 452 | - $frm_vars['css_loaded'] = true; |
|
| 453 | - } |
|
| 454 | - } |
|
| 455 | - |
|
| 456 | - // Get the stylesheets for the form settings page |
|
| 457 | - public static function get_style_opts() { |
|
| 458 | - $frm_style = new FrmStyle(); |
|
| 459 | - $styles = $frm_style->get_all(); |
|
| 460 | - |
|
| 461 | - return $styles; |
|
| 462 | - } |
|
| 463 | - |
|
| 464 | - public static function get_form_style( $form = 'default' ) { |
|
| 465 | - $style = FrmFormsHelper::get_form_style( $form ); |
|
| 466 | - |
|
| 467 | - if ( empty( $style ) || 1 == $style ) { |
|
| 468 | - $style = 'default'; |
|
| 469 | - } |
|
| 470 | - |
|
| 471 | - $frm_style = new FrmStyle( $style ); |
|
| 472 | - return $frm_style->get_one(); |
|
| 473 | - } |
|
| 474 | - |
|
| 475 | - /** |
|
| 476 | - * @param string $class |
|
| 477 | - * @param string $style |
|
| 478 | - */ |
|
| 436 | + /** |
|
| 437 | + * Check if the Formidable styling should be loaded, |
|
| 438 | + * then enqueue it for the footer |
|
| 439 | + * @since 2.0 |
|
| 440 | + */ |
|
| 441 | + public static function enqueue_style() { |
|
| 442 | + global $frm_vars; |
|
| 443 | + |
|
| 444 | + if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) { |
|
| 445 | + // the CSS has already been loaded |
|
| 446 | + return; |
|
| 447 | + } |
|
| 448 | + |
|
| 449 | + $frm_settings = FrmAppHelper::get_settings(); |
|
| 450 | + if ( $frm_settings->load_style != 'none' ) { |
|
| 451 | + wp_enqueue_style( 'formidable' ); |
|
| 452 | + $frm_vars['css_loaded'] = true; |
|
| 453 | + } |
|
| 454 | + } |
|
| 455 | + |
|
| 456 | + // Get the stylesheets for the form settings page |
|
| 457 | + public static function get_style_opts() { |
|
| 458 | + $frm_style = new FrmStyle(); |
|
| 459 | + $styles = $frm_style->get_all(); |
|
| 460 | + |
|
| 461 | + return $styles; |
|
| 462 | + } |
|
| 463 | + |
|
| 464 | + public static function get_form_style( $form = 'default' ) { |
|
| 465 | + $style = FrmFormsHelper::get_form_style( $form ); |
|
| 466 | + |
|
| 467 | + if ( empty( $style ) || 1 == $style ) { |
|
| 468 | + $style = 'default'; |
|
| 469 | + } |
|
| 470 | + |
|
| 471 | + $frm_style = new FrmStyle( $style ); |
|
| 472 | + return $frm_style->get_one(); |
|
| 473 | + } |
|
| 474 | + |
|
| 475 | + /** |
|
| 476 | + * @param string $class |
|
| 477 | + * @param string $style |
|
| 478 | + */ |
|
| 479 | 479 | public static function get_form_style_class( $class, $style ) { |
| 480 | 480 | if ( 1 == $style ) { |
| 481 | 481 | $style = 'default'; |
@@ -505,9 +505,9 @@ discard block |
||
| 505 | 505 | } |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | - /** |
|
| 509 | - * @param string $val |
|
| 510 | - */ |
|
| 508 | + /** |
|
| 509 | + * @param string $val |
|
| 510 | + */ |
|
| 511 | 511 | public static function get_style_val( $val, $form = 'default' ) { |
| 512 | 512 | $style = self::get_form_style( $form ); |
| 513 | 513 | if ( $style && isset( $style->post_content[ $val ] ) ) { |
@@ -517,72 +517,72 @@ discard block |
||
| 517 | 517 | |
| 518 | 518 | public static function show_entry_styles( $default_styles ) { |
| 519 | 519 | $frm_style = new FrmStyle( 'default' ); |
| 520 | - $style = $frm_style->get_one(); |
|
| 521 | - |
|
| 522 | - if ( ! $style ) { |
|
| 523 | - return $default_styles; |
|
| 524 | - } |
|
| 525 | - |
|
| 526 | - foreach ( $default_styles as $name => $val ) { |
|
| 527 | - $setting = $name; |
|
| 528 | - if ( 'border_width' == $name ) { |
|
| 529 | - $setting = 'field_border_width'; |
|
| 530 | - } else if ( 'alt_bg_color' == $name ) { |
|
| 531 | - $setting = 'bg_color_active'; |
|
| 532 | - } |
|
| 533 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
| 520 | + $style = $frm_style->get_one(); |
|
| 521 | + |
|
| 522 | + if ( ! $style ) { |
|
| 523 | + return $default_styles; |
|
| 524 | + } |
|
| 525 | + |
|
| 526 | + foreach ( $default_styles as $name => $val ) { |
|
| 527 | + $setting = $name; |
|
| 528 | + if ( 'border_width' == $name ) { |
|
| 529 | + $setting = 'field_border_width'; |
|
| 530 | + } else if ( 'alt_bg_color' == $name ) { |
|
| 531 | + $setting = 'bg_color_active'; |
|
| 532 | + } |
|
| 533 | + $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
| 534 | 534 | unset( $name, $val ); |
| 535 | - } |
|
| 535 | + } |
|
| 536 | 536 | |
| 537 | - return $default_styles; |
|
| 538 | - } |
|
| 537 | + return $default_styles; |
|
| 538 | + } |
|
| 539 | 539 | |
| 540 | 540 | public static function &important_style( $important, $field ) { |
| 541 | 541 | $important = self::get_style_val( 'important_style', $field['form_id'] ); |
| 542 | - return $important; |
|
| 543 | - } |
|
| 542 | + return $important; |
|
| 543 | + } |
|
| 544 | 544 | |
| 545 | - /** |
|
| 546 | - * Fallback for WP < 3.6 |
|
| 547 | - */ |
|
| 548 | - public static function do_accordion_sections( $screen, $context, $object ) { |
|
| 549 | - if ( function_exists( 'do_accordion_sections' ) ) { |
|
| 550 | - return do_accordion_sections( $screen, $context, $object ); |
|
| 551 | - } |
|
| 545 | + /** |
|
| 546 | + * Fallback for WP < 3.6 |
|
| 547 | + */ |
|
| 548 | + public static function do_accordion_sections( $screen, $context, $object ) { |
|
| 549 | + if ( function_exists( 'do_accordion_sections' ) ) { |
|
| 550 | + return do_accordion_sections( $screen, $context, $object ); |
|
| 551 | + } |
|
| 552 | 552 | |
| 553 | - global $wp_meta_boxes; |
|
| 553 | + global $wp_meta_boxes; |
|
| 554 | 554 | |
| 555 | - $screen = 'formidable_page_formidable-styles'; |
|
| 556 | - $screen = convert_to_screen( $screen ); |
|
| 555 | + $screen = 'formidable_page_formidable-styles'; |
|
| 556 | + $screen = convert_to_screen( $screen ); |
|
| 557 | 557 | |
| 558 | - $page = $screen->id; |
|
| 558 | + $page = $screen->id; |
|
| 559 | 559 | |
| 560 | - $hidden = get_hidden_meta_boxes( $screen ); |
|
| 561 | - ?> |
|
| 560 | + $hidden = get_hidden_meta_boxes( $screen ); |
|
| 561 | + ?> |
|
| 562 | 562 | <div id="side-sortables" class="accordion-container"> |
| 563 | 563 | <?php |
| 564 | - $i = 0; |
|
| 565 | - $first_open = false; |
|
| 566 | - do { |
|
| 564 | + $i = 0; |
|
| 565 | + $first_open = false; |
|
| 566 | + do { |
|
| 567 | 567 | if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[ $page ] ) || ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) { |
| 568 | 568 | break; |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | - foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
|
| 572 | - if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
| 573 | - foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
| 574 | - if ( false == $box || ! $box['title'] ) { |
|
| 575 | - continue; |
|
| 571 | + foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
|
| 572 | + if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
| 573 | + foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
| 574 | + if ( false == $box || ! $box['title'] ) { |
|
| 575 | + continue; |
|
| 576 | 576 | } |
| 577 | 577 | |
| 578 | - $i++; |
|
| 579 | - $hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : ''; |
|
| 578 | + $i++; |
|
| 579 | + $hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : ''; |
|
| 580 | 580 | |
| 581 | - if ( ! $first_open && empty( $hidden_class ) ) { |
|
| 582 | - $first_open = true; |
|
| 583 | - } |
|
| 581 | + if ( ! $first_open && empty( $hidden_class ) ) { |
|
| 582 | + $first_open = true; |
|
| 583 | + } |
|
| 584 | 584 | |
| 585 | - ?> |
|
| 585 | + ?> |
|
| 586 | 586 | <div class="postbox <?php echo esc_attr( $box['id'] ); ?>"> |
| 587 | 587 | <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'formidable' ); ?>"><br/></div> |
| 588 | 588 | <h3 class='hndle'><span><?php echo esc_html( $box['title'] ); ?></span></h3> |
@@ -593,13 +593,13 @@ discard block |
||
| 593 | 593 | </div><!-- .accordion-section-content --> |
| 594 | 594 | </div><!-- .postbox --> |
| 595 | 595 | <?php |
| 596 | - } |
|
| 597 | - } |
|
| 598 | - } |
|
| 599 | - } while ( 0 ); |
|
| 600 | - ?> |
|
| 596 | + } |
|
| 597 | + } |
|
| 598 | + } |
|
| 599 | + } while ( 0 ); |
|
| 600 | + ?> |
|
| 601 | 601 | </div><!-- .accordion-container --> |
| 602 | 602 | <?php |
| 603 | - return $i; |
|
| 604 | - } |
|
| 603 | + return $i; |
|
| 604 | + } |
|
| 605 | 605 | } |