WordPress 4.5
[autoinstalls/wordpress.git] / wp-includes / customize / class-wp-customize-media-control.php
index c99fd986f2efb79c878436214222aae353cf9687..f066c022455624e9880423ec8eb3479a3921ea79 100644 (file)
@@ -55,15 +55,17 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
        public function __construct( $manager, $id, $args = array() ) {
                parent::__construct( $manager, $id, $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' ),
-               );
+               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' ),
+                       ) );
+               }
        }
 
        /**
@@ -193,8 +195,8 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
                        </div>
                        <div class="actions">
                                <# if ( data.canUpload ) { #>
-                               <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
-                               <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['change']; ?></button>
+                               <button type="button" class="button remove-button">{{ data.button_labels.remove }}</button>
+                               <button type="button" class="button upload-button control-focus" id="{{ data.settings['default'] }}-button">{{ data.button_labels.change }}</button>
                                <div style="clear:both"></div>
                                <# } #>
                        </div>
@@ -204,7 +206,7 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
                                        <div class="placeholder">
                                                <div class="inner">
                                                        <span>
-                                                               <?php echo $this->button_labels['placeholder']; ?>
+                                                               {{ data.button_labels.placeholder }}
                                                        </span>
                                                </div>
                                        </div>
@@ -212,10 +214,10 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
                        </div>
                        <div class="actions">
                                <# if ( data.defaultAttachment ) { #>
-                                       <button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button>
+                                       <button type="button" class="button default-button">{{ data.button_labels.default }}</button>
                                <# } #>
                                <# if ( data.canUpload ) { #>
-                               <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button>
+                               <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button">{{ data.button_labels.select }}</button>
                                <# } #>
                                <div style="clear:both"></div>
                        </div>