diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 5e66a1aa75..87a14193f3 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -4004,14 +4004,6 @@ final class WP_Customize_Manager { 'description' => $control_description, 'section' => 'header_image', 'mime_type' => 'video', - // @todo These button_labels can be removed once WP_Customize_Media_Control provides mime_type-specific labels automatically. See . - 'button_labels' => array( - 'select' => __( 'Select Video' ), - 'change' => __( 'Change Video' ), - 'placeholder' => __( 'No video selected' ), - 'frame_title' => __( 'Select Video' ), - 'frame_button' => __( 'Choose Video' ), - ), 'active_callback' => 'is_header_video_active', ) ) ); diff --git a/src/wp-includes/customize/class-wp-customize-image-control.php b/src/wp-includes/customize/class-wp-customize-image-control.php index 38ac608f1f..d056f8be61 100644 --- a/src/wp-includes/customize/class-wp-customize-image-control.php +++ b/src/wp-includes/customize/class-wp-customize-image-control.php @@ -18,30 +18,6 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control { public $type = 'image'; public $mime_type = 'image'; - /** - * Constructor. - * - * @since 3.4.0 - * @uses WP_Customize_Upload_Control::__construct() - * - * @param WP_Customize_Manager $manager Customizer bootstrap instance. - * @param string $id Control ID. - * @param array $args Optional. Arguments to override class property defaults. - */ - public function __construct( $manager, $id, $args = array() ) { - parent::__construct( $manager, $id, $args ); - - $this->button_labels = wp_parse_args( $this->button_labels, array( - 'select' => __( 'Select Image' ), - 'change' => __( 'Change Image' ), - 'remove' => __( 'Remove' ), - 'default' => __( 'Default' ), - 'placeholder' => __( 'No image selected' ), - 'frame_title' => __( 'Select Image' ), - 'frame_button' => __( 'Choose Image' ), - ) ); - } - /** * @since 3.4.2 * @deprecated 4.1.0 diff --git a/src/wp-includes/customize/class-wp-customize-media-control.php b/src/wp-includes/customize/class-wp-customize-media-control.php index 446713f623..db990cda69 100644 --- a/src/wp-includes/customize/class-wp-customize-media-control.php +++ b/src/wp-includes/customize/class-wp-customize-media-control.php @@ -52,17 +52,7 @@ class WP_Customize_Media_Control extends WP_Customize_Control { public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); - if ( ! ( $this instanceof WP_Customize_Image_Control ) ) { - $this->button_labels = wp_parse_args( $this->button_labels, array( - 'select' => __( 'Select File' ), - 'change' => __( 'Change File' ), - 'default' => __( 'Default' ), - 'remove' => __( 'Remove' ), - 'placeholder' => __( 'No file selected' ), - 'frame_title' => __( 'Select File' ), - 'frame_button' => __( 'Choose File' ), - ) ); - } + $this->button_labels = wp_parse_args( $this->button_labels, $this->get_default_button_labels() ); } /** @@ -209,4 +199,61 @@ class WP_Customize_Media_Control extends WP_Customize_Control { <# } #> mime_type ) ? strtok( ltrim( $this->mime_type, '/' ), '/' ) : 'default'; + + switch ( $mime_type ) { + case 'video': + return array( + 'select' => __( 'Select video' ), + 'change' => __( 'Change video' ), + 'default' => __( 'Default' ), + 'remove' => __( 'Remove' ), + 'placeholder' => __( 'No video selected' ), + 'frame_title' => __( 'Select video' ), + 'frame_button' => __( 'Choose video' ), + ); + case 'audio': + return array( + 'select' => __( 'Select audio' ), + 'change' => __( 'Change audio' ), + 'default' => __( 'Default' ), + 'remove' => __( 'Remove' ), + 'placeholder' => __( 'No audio selected' ), + 'frame_title' => __( 'Select audio' ), + 'frame_button' => __( 'Choose audio' ), + ); + case 'image': + return array( + 'select' => __( 'Select image' ), + 'change' => __( 'Change image' ), + 'default' => __( 'Default' ), + 'remove' => __( 'Remove' ), + 'placeholder' => __( 'No image selected' ), + 'frame_title' => __( 'Select image' ), + 'frame_button' => __( 'Choose image' ), + ); + default: + return array( + 'select' => __( 'Select file' ), + 'change' => __( 'Change file' ), + 'default' => __( 'Default' ), + 'remove' => __( 'Remove' ), + 'placeholder' => __( 'No file selected' ), + 'frame_title' => __( 'Select file' ), + 'frame_button' => __( 'Choose file' ), + ); + } // End switch(). + } }