@@ -22,7 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @param $value |
24 | 24 | */ |
25 | - public function update( $value ) { |
|
26 | - remove_theme_mod( 'background_image_thumb' ); |
|
25 | + public function update($value) { |
|
26 | + remove_theme_mod('background_image_thumb'); |
|
27 | 27 | } |
28 | 28 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function render_content() { |
35 | 35 | ?> |
36 | - <button type="button" class="button button-primary" id="create-new-menu-submit"><?php _e( 'Create Menu' ); ?></button> |
|
36 | + <button type="button" class="button button-primary" id="create-new-menu-submit"><?php _e('Create Menu'); ?></button> |
|
37 | 37 | <span class="spinner"></span> |
38 | 38 | <?php |
39 | 39 | } |
@@ -34,46 +34,46 @@ |
||
34 | 34 | * @access protected |
35 | 35 | */ |
36 | 36 | protected function render() { |
37 | - $classes = 'accordion-section control-section control-section-' . $this->type; |
|
37 | + $classes = 'accordion-section control-section control-section-'.$this->type; |
|
38 | 38 | ?> |
39 | - <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> |
|
39 | + <li id="accordion-section-<?php echo esc_attr($this->id); ?>" class="<?php echo esc_attr($classes); ?>"> |
|
40 | 40 | <h3 class="accordion-section-title"> |
41 | 41 | <?php |
42 | - if ( $this->manager->is_theme_active() ) { |
|
43 | - echo '<span class="customize-action">' . __( 'Active theme' ) . '</span> ' . $this->title; |
|
42 | + if ($this->manager->is_theme_active()) { |
|
43 | + echo '<span class="customize-action">'.__('Active theme').'</span> '.$this->title; |
|
44 | 44 | } else { |
45 | - echo '<span class="customize-action">' . __( 'Previewing theme' ) . '</span> ' . $this->title; |
|
45 | + echo '<span class="customize-action">'.__('Previewing theme').'</span> '.$this->title; |
|
46 | 46 | } |
47 | 47 | ?> |
48 | 48 | |
49 | - <?php if ( count( $this->controls ) > 0 ) : ?> |
|
50 | - <button type="button" class="button change-theme" tabindex="0"><?php _ex( 'Change', 'theme' ); ?></button> |
|
49 | + <?php if (count($this->controls) > 0) : ?> |
|
50 | + <button type="button" class="button change-theme" tabindex="0"><?php _ex('Change', 'theme'); ?></button> |
|
51 | 51 | <?php endif; ?> |
52 | 52 | </h3> |
53 | 53 | <div class="customize-themes-panel control-panel-content themes-php"> |
54 | 54 | <h3 class="accordion-section-title customize-section-title"> |
55 | - <span class="customize-action"><?php _e( 'Customizing' ); ?></span> |
|
56 | - <?php _e( 'Themes' ); ?> |
|
57 | - <span class="title-count theme-count"><?php echo count( $this->controls ) + 1 /* Active theme */; ?></span> |
|
55 | + <span class="customize-action"><?php _e('Customizing'); ?></span> |
|
56 | + <?php _e('Themes'); ?> |
|
57 | + <span class="title-count theme-count"><?php echo count($this->controls) + 1 /* Active theme */; ?></span> |
|
58 | 58 | </h3> |
59 | 59 | <h3 class="accordion-section-title customize-section-title"> |
60 | 60 | <?php |
61 | - if ( $this->manager->is_theme_active() ) { |
|
62 | - echo '<span class="customize-action">' . __( 'Active theme' ) . '</span> ' . $this->title; |
|
61 | + if ($this->manager->is_theme_active()) { |
|
62 | + echo '<span class="customize-action">'.__('Active theme').'</span> '.$this->title; |
|
63 | 63 | } else { |
64 | - echo '<span class="customize-action">' . __( 'Previewing theme' ) . '</span> ' . $this->title; |
|
64 | + echo '<span class="customize-action">'.__('Previewing theme').'</span> '.$this->title; |
|
65 | 65 | } |
66 | 66 | ?> |
67 | - <button type="button" class="button customize-theme"><?php _e( 'Customize' ); ?></button> |
|
67 | + <button type="button" class="button customize-theme"><?php _e('Customize'); ?></button> |
|
68 | 68 | </h3> |
69 | 69 | |
70 | - <div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div> |
|
70 | + <div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e('Theme Details'); ?>"></div> |
|
71 | 71 | |
72 | 72 | <div id="customize-container"></div> |
73 | - <?php if ( count( $this->controls ) > 4 ) : ?> |
|
73 | + <?php if (count($this->controls) > 4) : ?> |
|
74 | 74 | <p><label for="themes-filter"> |
75 | - <span class="screen-reader-text"><?php _e( 'Search installed themes…' ); ?></span> |
|
76 | - <input type="text" id="themes-filter" placeholder="<?php esc_attr_e( 'Search installed themes…' ); ?>" /> |
|
75 | + <span class="screen-reader-text"><?php _e('Search installed themes…'); ?></span> |
|
76 | + <input type="text" id="themes-filter" placeholder="<?php esc_attr_e('Search installed themes…'); ?>" /> |
|
77 | 77 | </label></p> |
78 | 78 | <?php endif; ?> |
79 | 79 | <div class="theme-browser rendered"> |
@@ -31,12 +31,14 @@ |
||
31 | 31 | |
32 | 32 | // If the value doesn't exist (removed or random), |
33 | 33 | // use the header_image value. |
34 | - if ( ! $value ) |
|
35 | - $value = $this->manager->get_setting('header_image')->post_value(); |
|
34 | + if ( ! $value ) { |
|
35 | + $value = $this->manager->get_setting('header_image')->post_value(); |
|
36 | + } |
|
36 | 37 | |
37 | - if ( is_array( $value ) && isset( $value['choice'] ) ) |
|
38 | - $custom_image_header->set_header_image( $value['choice'] ); |
|
39 | - else |
|
40 | - $custom_image_header->set_header_image( $value ); |
|
38 | + if ( is_array( $value ) && isset( $value['choice'] ) ) { |
|
39 | + $custom_image_header->set_header_image( $value['choice'] ); |
|
40 | + } else { |
|
41 | + $custom_image_header->set_header_image( $value ); |
|
42 | + } |
|
41 | 43 | } |
42 | 44 | } |
@@ -26,26 +26,26 @@ |
||
26 | 26 | * |
27 | 27 | * @param $value |
28 | 28 | */ |
29 | - public function update( $value ) { |
|
29 | + public function update($value) { |
|
30 | 30 | global $custom_image_header; |
31 | 31 | |
32 | 32 | // If _custom_header_background_just_in_time() fails to initialize $custom_image_header when not is_admin(). |
33 | - if ( empty( $custom_image_header ) ) { |
|
34 | - require_once( ABSPATH . 'wp-admin/custom-header.php' ); |
|
35 | - $args = get_theme_support( 'custom-header' ); |
|
36 | - $admin_head_callback = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null; |
|
37 | - $admin_preview_callback = isset( $args[0]['admin-preview-callback'] ) ? $args[0]['admin-preview-callback'] : null; |
|
38 | - $custom_image_header = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback ); |
|
33 | + if (empty($custom_image_header)) { |
|
34 | + require_once(ABSPATH.'wp-admin/custom-header.php'); |
|
35 | + $args = get_theme_support('custom-header'); |
|
36 | + $admin_head_callback = isset($args[0]['admin-head-callback']) ? $args[0]['admin-head-callback'] : null; |
|
37 | + $admin_preview_callback = isset($args[0]['admin-preview-callback']) ? $args[0]['admin-preview-callback'] : null; |
|
38 | + $custom_image_header = new Custom_Image_Header($admin_head_callback, $admin_preview_callback); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | // If the value doesn't exist (removed or random), |
42 | 42 | // use the header_image value. |
43 | - if ( ! $value ) |
|
43 | + if ( ! $value) |
|
44 | 44 | $value = $this->manager->get_setting('header_image')->post_value(); |
45 | 45 | |
46 | - if ( is_array( $value ) && isset( $value['choice'] ) ) |
|
47 | - $custom_image_header->set_header_image( $value['choice'] ); |
|
46 | + if (is_array($value) && isset($value['choice'])) |
|
47 | + $custom_image_header->set_header_image($value['choice']); |
|
48 | 48 | else |
49 | - $custom_image_header->set_header_image( $value ); |
|
49 | + $custom_image_header->set_header_image($value); |
|
50 | 50 | } |
51 | 51 | } |
@@ -33,11 +33,11 @@ |
||
33 | 33 | parent::to_json(); |
34 | 34 | |
35 | 35 | $value = $this->value(); |
36 | - if ( $value ) { |
|
36 | + if ($value) { |
|
37 | 37 | // Get the attachment model for the existing file. |
38 | - $attachment_id = attachment_url_to_postid( $value ); |
|
39 | - if ( $attachment_id ) { |
|
40 | - $this->json['attachment'] = wp_prepare_attachment_for_js( $attachment_id ); |
|
38 | + $attachment_id = attachment_url_to_postid($value); |
|
39 | + if ($attachment_id) { |
|
40 | + $this->json['attachment'] = wp_prepare_attachment_for_js($attachment_id); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | } |
@@ -26,5 +26,5 @@ |
||
26 | 26 | * |
27 | 27 | * @param mixed $value The value to update. |
28 | 28 | */ |
29 | - public function update( $value ) {} |
|
29 | + public function update($value) {} |
|
30 | 30 | } |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function render_screen_options() { |
37 | 37 | // Adds the screen options. |
38 | - require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; |
|
39 | - add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' ); |
|
38 | + require_once ABSPATH.'wp-admin/includes/nav-menu.php'; |
|
39 | + add_filter('manage_nav-menus_columns', 'wp_nav_menu_manage_columns'); |
|
40 | 40 | |
41 | 41 | // Display screen options. |
42 | - $screen = WP_Screen::get( 'nav-menus.php' ); |
|
43 | - $screen->render_screen_options( array( 'wrap' => false ) ); |
|
42 | + $screen = WP_Screen::get('nav-menus.php'); |
|
43 | + $screen->render_screen_options(array('wrap' => false)); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | * @deprecated 4.5.0 Deprecated in favor of wp_nav_menu_manage_columns(). |
53 | 53 | */ |
54 | 54 | public function wp_nav_menu_manage_columns() { |
55 | - _deprecated_function( __METHOD__, '4.5.0', 'wp_nav_menu_manage_columns' ); |
|
56 | - require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; |
|
55 | + _deprecated_function(__METHOD__, '4.5.0', 'wp_nav_menu_manage_columns'); |
|
56 | + require_once ABSPATH.'wp-admin/includes/nav-menu.php'; |
|
57 | 57 | return wp_nav_menu_manage_columns(); |
58 | 58 | } |
59 | 59 | |
@@ -72,20 +72,20 @@ discard block |
||
72 | 72 | ?> |
73 | 73 | <li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>"> |
74 | 74 | <button type="button" class="customize-panel-back" tabindex="-1"> |
75 | - <span class="screen-reader-text"><?php _e( 'Back' ); ?></span> |
|
75 | + <span class="screen-reader-text"><?php _e('Back'); ?></span> |
|
76 | 76 | </button> |
77 | 77 | <div class="accordion-section-title"> |
78 | 78 | <span class="preview-notice"> |
79 | 79 | <?php |
80 | 80 | /* translators: %s: the site/panel title in the Customizer */ |
81 | - printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' ); |
|
81 | + printf(__('You are customizing %s'), '<strong class="panel-title">{{ data.title }}</strong>'); |
|
82 | 82 | ?> |
83 | 83 | </span> |
84 | 84 | <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"> |
85 | - <span class="screen-reader-text"><?php _e( 'Help' ); ?></span> |
|
85 | + <span class="screen-reader-text"><?php _e('Help'); ?></span> |
|
86 | 86 | </button> |
87 | 87 | <button type="button" class="customize-screen-options-toggle" aria-expanded="false"> |
88 | - <span class="screen-reader-text"><?php _e( 'Menu Options' ); ?></span> |
|
88 | + <span class="screen-reader-text"><?php _e('Menu Options'); ?></span> |
|
89 | 89 | </button> |
90 | 90 | </div> |
91 | 91 | <# if ( data.description ) { #> |
@@ -28,18 +28,18 @@ discard block |
||
28 | 28 | * @param string $id Control ID. |
29 | 29 | * @param array $args Optional. Arguments to override class property defaults. |
30 | 30 | */ |
31 | - public function __construct( $manager, $id, $args = array() ) { |
|
32 | - parent::__construct( $manager, $id, $args ); |
|
31 | + public function __construct($manager, $id, $args = array()) { |
|
32 | + parent::__construct($manager, $id, $args); |
|
33 | 33 | |
34 | - $this->button_labels = wp_parse_args( $this->button_labels, array( |
|
35 | - 'select' => __( 'Select Image' ), |
|
36 | - 'change' => __( 'Change Image' ), |
|
37 | - 'remove' => __( 'Remove' ), |
|
38 | - 'default' => __( 'Default' ), |
|
39 | - 'placeholder' => __( 'No image selected' ), |
|
40 | - 'frame_title' => __( 'Select Image' ), |
|
41 | - 'frame_button' => __( 'Choose Image' ), |
|
42 | - ) ); |
|
34 | + $this->button_labels = wp_parse_args($this->button_labels, array( |
|
35 | + 'select' => __('Select Image'), |
|
36 | + 'change' => __('Change Image'), |
|
37 | + 'remove' => __('Remove'), |
|
38 | + 'default' => __('Default'), |
|
39 | + 'placeholder' => __('No image selected'), |
|
40 | + 'frame_title' => __('Select Image'), |
|
41 | + 'frame_button' => __('Choose Image'), |
|
42 | + )); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param string $label |
57 | 57 | * @param mixed $callback |
58 | 58 | */ |
59 | - public function add_tab( $id, $label, $callback ) {} |
|
59 | + public function add_tab($id, $label, $callback) {} |
|
60 | 60 | |
61 | 61 | /** |
62 | 62 | * @since 3.4.0 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @param string $id |
66 | 66 | */ |
67 | - public function remove_tab( $id ) {} |
|
67 | + public function remove_tab($id) {} |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * @since 3.4.0 |
@@ -73,5 +73,5 @@ discard block |
||
73 | 73 | * @param string $url |
74 | 74 | * @param string $thumbnail_url |
75 | 75 | */ |
76 | - public function print_tab_image( $url, $thumbnail_url = null ) {} |
|
76 | + public function print_tab_image($url, $thumbnail_url = null) {} |
|
77 | 77 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @access public |
69 | 69 | */ |
70 | 70 | public function enqueue() { |
71 | - wp_enqueue_script( 'customize-views' ); |
|
71 | + wp_enqueue_script('customize-views'); |
|
72 | 72 | |
73 | 73 | parent::enqueue(); |
74 | 74 | } |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | public function to_json() { |
85 | 85 | parent::to_json(); |
86 | 86 | |
87 | - $this->json['width'] = absint( $this->width ); |
|
88 | - $this->json['height'] = absint( $this->height ); |
|
89 | - $this->json['flex_width'] = absint( $this->flex_width ); |
|
90 | - $this->json['flex_height'] = absint( $this->flex_height ); |
|
87 | + $this->json['width'] = absint($this->width); |
|
88 | + $this->json['height'] = absint($this->height); |
|
89 | + $this->json['flex_width'] = absint($this->flex_width); |
|
90 | + $this->json['flex_height'] = absint($this->flex_height); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | } |