- Timestamp:
- 09/20/2017 09:23:51 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/customize/class-wp-customize-media-control.php
r41162 r41550 53 53 parent::__construct( $manager, $id, $args ); 54 54 55 if ( ! ( $this instanceof WP_Customize_Image_Control ) ) { 56 $this->button_labels = wp_parse_args( $this->button_labels, array( 57 'select' => __( 'Select File' ), 58 'change' => __( 'Change File' ), 59 'default' => __( 'Default' ), 60 'remove' => __( 'Remove' ), 61 'placeholder' => __( 'No file selected' ), 62 'frame_title' => __( 'Select File' ), 63 'frame_button' => __( 'Choose File' ), 64 ) ); 65 } 55 $this->button_labels = wp_parse_args( $this->button_labels, $this->get_default_button_labels() ); 66 56 } 67 57 … … 210 200 <?php 211 201 } 202 203 /** 204 * Get default button labels. 205 * 206 * Provides an array of the default button labels based on the mime type of the current control. 207 * 208 * @since 4.9.0 209 * 210 * @return array An associative array of default button labels. 211 */ 212 public function get_default_button_labels() { 213 // Get just the mime type and strip the mime subtype if present. 214 $mime_type = ! empty( $this->mime_type ) ? strtok( ltrim( $this->mime_type, '/' ), '/' ) : 'default'; 215 216 switch ( $mime_type ) { 217 case 'video': 218 return array( 219 'select' => __( 'Select video' ), 220 'change' => __( 'Change video' ), 221 'default' => __( 'Default' ), 222 'remove' => __( 'Remove' ), 223 'placeholder' => __( 'No video selected' ), 224 'frame_title' => __( 'Select video' ), 225 'frame_button' => __( 'Choose video' ), 226 ); 227 case 'audio': 228 return array( 229 'select' => __( 'Select audio' ), 230 'change' => __( 'Change audio' ), 231 'default' => __( 'Default' ), 232 'remove' => __( 'Remove' ), 233 'placeholder' => __( 'No audio selected' ), 234 'frame_title' => __( 'Select audio' ), 235 'frame_button' => __( 'Choose audio' ), 236 ); 237 case 'image': 238 return array( 239 'select' => __( 'Select image' ), 240 'change' => __( 'Change image' ), 241 'default' => __( 'Default' ), 242 'remove' => __( 'Remove' ), 243 'placeholder' => __( 'No image selected' ), 244 'frame_title' => __( 'Select image' ), 245 'frame_button' => __( 'Choose image' ), 246 ); 247 default: 248 return array( 249 'select' => __( 'Select file' ), 250 'change' => __( 'Change file' ), 251 'default' => __( 'Default' ), 252 'remove' => __( 'Remove' ), 253 'placeholder' => __( 'No file selected' ), 254 'frame_title' => __( 'Select file' ), 255 'frame_button' => __( 'Choose file' ), 256 ); 257 } // End switch(). 258 } 212 259 }
Note: See TracChangeset
for help on using the changeset viewer.