diff -r c7c34916027a -r 177826044cd9 wp/wp-includes/customize/class-wp-customize-header-image-control.php --- a/wp/wp-includes/customize/class-wp-customize-header-image-control.php Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-includes/customize/class-wp-customize-header-image-control.php Mon Oct 14 18:28:13 2019 +0200 @@ -15,8 +15,28 @@ * @see WP_Customize_Image_Control */ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control { + /** + * Customize control type. + * + * @since 4.2.0 + * @var string + */ public $type = 'header'; + + /** + * Uploaded header images. + * + * @since 3.9.0 + * @var string + */ public $uploaded_headers; + + /** + * Default header images. + * + * @since 3.9.0 + * @var string + */ public $default_headers; /** @@ -27,16 +47,20 @@ * @param WP_Customize_Manager $manager Customizer bootstrap instance. */ public function __construct( $manager ) { - parent::__construct( $manager, 'header_image', array( - 'label' => __( 'Header Image' ), - 'settings' => array( - 'default' => 'header_image', - 'data' => 'header_image_data', - ), - 'section' => 'header_image', - 'removed' => 'remove-header', - 'get_url' => 'get_header_image', - ) ); + parent::__construct( + $manager, + 'header_image', + array( + 'label' => __( 'Header Image' ), + 'settings' => array( + 'default' => 'header_image', + 'data' => 'header_image_data', + ), + 'section' => 'header_image', + 'removed' => 'remove-header', + 'get_url' => 'get_header_image', + ) + ); } @@ -48,27 +72,30 @@ $this->prepare_control(); - wp_localize_script( 'customize-views', '_wpCustomizeHeader', array( - 'data' => array( - 'width' => absint( get_theme_support( 'custom-header', 'width' ) ), - 'height' => absint( get_theme_support( 'custom-header', 'height' ) ), - 'flex-width' => absint( get_theme_support( 'custom-header', 'flex-width' ) ), - 'flex-height' => absint( get_theme_support( 'custom-header', 'flex-height' ) ), - 'currentImgSrc' => $this->get_current_image_src(), - ), - 'nonces' => array( - 'add' => wp_create_nonce( 'header-add' ), - 'remove' => wp_create_nonce( 'header-remove' ), - ), - 'uploads' => $this->uploaded_headers, - 'defaults' => $this->default_headers - ) ); + wp_localize_script( + 'customize-views', + '_wpCustomizeHeader', + array( + 'data' => array( + 'width' => absint( get_theme_support( 'custom-header', 'width' ) ), + 'height' => absint( get_theme_support( 'custom-header', 'height' ) ), + 'flex-width' => absint( get_theme_support( 'custom-header', 'flex-width' ) ), + 'flex-height' => absint( get_theme_support( 'custom-header', 'flex-height' ) ), + 'currentImgSrc' => $this->get_current_image_src(), + ), + 'nonces' => array( + 'add' => wp_create_nonce( 'header-add' ), + 'remove' => wp_create_nonce( 'header-remove' ), + ), + 'uploads' => $this->uploaded_headers, + 'defaults' => $this->default_headers, + ) + ); parent::enqueue(); } /** - * * @global Custom_Image_Header $custom_image_header */ public function prepare_control() { @@ -81,7 +108,7 @@ // Process default headers and uploaded headers. $custom_image_header->process_default_headers(); - $this->default_headers = $custom_image_header->get_default_header_images(); + $this->default_headers = $custom_image_header->get_default_header_images(); $this->uploaded_headers = $custom_image_header->get_uploaded_header_images(); } @@ -160,31 +187,36 @@ */ public function render_content() { $visibility = $this->get_current_image_src() ? '' : ' style="display:none" '; - $width = absint( get_theme_support( 'custom-header', 'width' ) ); - $height = absint( get_theme_support( 'custom-header', 'height' ) ); + $width = absint( get_theme_support( 'custom-header', 'width' ) ); + $height = absint( get_theme_support( 'custom-header', 'height' ) ); ?>
%s × %s', $width, $height ) ); } elseif ( $width ) { - /* translators: %s: header width in pixels */ - printf( __( 'Click “Add new image” to upload an image file from your computer. Your theme works best with an image with a header width of %s pixels — you’ll be able to crop your image once you upload it for a perfect fit.' ), + printf( + /* translators: %s: header width in pixels */ + __( 'Click “Add new image” to upload an image file from your computer. Your theme works best with an image with a header width of %s pixels — you’ll be able to crop your image once you upload it for a perfect fit.' ), sprintf( '%s', $width ) ); } else { - /* translators: %s: header height in pixels */ - printf( __( 'Click “Add new image” to upload an image file from your computer. Your theme works best with an image with a header height of %s pixels — you’ll be able to crop your image once you upload it for a perfect fit.' ), + printf( + /* translators: %s: header height in pixels */ + __( 'Click “Add new image” to upload an image file from your computer. Your theme works best with an image with a header height of %s pixels — you’ll be able to crop your image once you upload it for a perfect fit.' ), sprintf( '%s', $height ) ); } @@ -200,7 +232,7 @@