diff -r c7c34916027a -r 177826044cd9 wp/wp-includes/customize/class-wp-customize-media-control.php --- a/wp/wp-includes/customize/class-wp-customize-media-control.php Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-includes/customize/class-wp-customize-media-control.php Mon Oct 14 18:28:13 2019 +0200 @@ -75,10 +75,10 @@ */ public function to_json() { parent::to_json(); - $this->json['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) ); - $this->json['mime_type'] = $this->mime_type; + $this->json['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) ); + $this->json['mime_type'] = $this->mime_type; $this->json['button_labels'] = $this->button_labels; - $this->json['canUpload'] = current_user_can( 'upload_files' ); + $this->json['canUpload'] = current_user_can( 'upload_files' ); $value = $this->value(); @@ -86,13 +86,13 @@ if ( $this->setting->default ) { // Fake an attachment model - needs all fields used by template. // Note that the default value must be a URL, NOT an attachment ID. - $type = in_array( substr( $this->setting->default, -3 ), array( 'jpg', 'png', 'gif', 'bmp' ) ) ? 'image' : 'document'; + $type = in_array( substr( $this->setting->default, -3 ), array( 'jpg', 'png', 'gif', 'bmp' ) ) ? 'image' : 'document'; $default_attachment = array( - 'id' => 1, - 'url' => $this->setting->default, - 'type' => $type, - 'icon' => wp_mime_type_icon( $type ), - 'title' => basename( $this->setting->default ), + 'id' => 1, + 'url' => $this->setting->default, + 'type' => $type, + 'icon' => wp_mime_type_icon( $type ), + 'title' => wp_basename( $this->setting->default ), ); if ( 'image' === $type ) { @@ -132,12 +132,11 @@ public function content_template() { ?> <# - var selectButtonId = _.uniqueId( 'customize-media-control-button-' ); var descriptionId = _.uniqueId( 'customize-media-control-description-' ); var describedByAttr = data.description ? ' aria-describedby="' + descriptionId + '" ' : ''; #> <# if ( data.label ) { #> - + {{ data.label }} <# } #>
<# if ( data.description ) { #> @@ -182,22 +181,19 @@
<# if ( data.canUpload ) { #> - + <# } #>
<# } else { #>
-
- {{ data.button_labels.placeholder }} -
+ <# if ( data.canUpload ) { #> + + <# } #>
<# if ( data.defaultAttachment ) { #> <# } #> - <# if ( data.canUpload ) { #> - - <# } #>
<# } #> @@ -241,6 +237,7 @@ case 'image': return array( 'select' => __( 'Select image' ), + 'site_icon' => __( 'Select site icon' ), 'change' => __( 'Change image' ), 'default' => __( 'Default' ), 'remove' => __( 'Remove' ),