diff --git a/src/wp-admin/css/customize-controls.css b/src/wp-admin/css/customize-controls.css index d3dbe764ff..f956da18f8 100644 --- a/src/wp-admin/css/customize-controls.css +++ b/src/wp-admin/css/customize-controls.css @@ -1379,6 +1379,7 @@ p.customize-section-description { } .customize-control .attachment-media-view .placeholder, +.customize-control .attachment-media-view .button-add-media, .customize-control-header .placeholder { width: 100%; position: relative; @@ -1390,6 +1391,26 @@ p.customize-section-description { line-height: 20px; } +.customize-control .attachment-media-view .button-add-media { + cursor: pointer; + background-color: #edeff0; + color: #32373c; +} + +.customize-control .attachment-media-view .button-add-media:hover { + background-color: #fbfbfc; +} + +.customize-control .attachment-media-view .button-add-media:focus { + background-color: #fbfbfc; + border-style: solid; + border-color: #5b9dd9; + box-shadow: 0 0 3px rgba( 0, 115, 170, .8 ); + /* Only visible in Windows High Contrast mode */ + outline: 2px solid transparent; + outline-offset: -2px; +} + .customize-control-header .inner { display: none; position: absolute; diff --git a/src/wp-admin/css/widgets.css b/src/wp-admin/css/widgets.css index eea7a913e4..f1c3a3c251 100644 --- a/src/wp-admin/css/widgets.css +++ b/src/wp-admin/css/widgets.css @@ -84,6 +84,7 @@ margin-right: 8px; } +.media-widget-control .attachment-media-view .button-add-media, .media-widget-control .placeholder { border: 1px dashed #b4b9be; box-sizing: border-box; @@ -95,6 +96,26 @@ width: 100%; } +.media-widget-control .attachment-media-view .button-add-media { + cursor: pointer; + background-color: #edeff0; + color: #32373c; +} + +.media-widget-control .attachment-media-view .button-add-media:hover { + background-color: #fbfbfc; +} + +.media-widget-control .attachment-media-view .button-add-media:focus { + background-color: #fbfbfc; + border-style: solid; + border-color: #5b9dd9; + box-shadow: 0 0 3px rgba( 0, 115, 170, .8 ); + /* Only visible in Windows High Contrast mode */ + outline: 2px solid transparent; + outline-offset: -2px; +} + .media-widget-control .media-widget-preview { background: transparent; text-align: center; 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 98d9310494..55f7b9b698 100644 --- a/src/wp-includes/customize/class-wp-customize-media-control.php +++ b/src/wp-includes/customize/class-wp-customize-media-control.php @@ -132,12 +132,11 @@ class WP_Customize_Media_Control extends WP_Customize_Control { 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 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
<# if ( data.canUpload ) { #> - + <# } #>
<# } else { #>
-
- {{ data.button_labels.placeholder }} -
+ <# if ( data.canUpload ) { #> + + <# } #>
<# if ( data.defaultAttachment ) { #> <# } #> - <# if ( data.canUpload ) { #> - - <# } #>
<# } #> @@ -241,6 +237,7 @@ class WP_Customize_Media_Control extends WP_Customize_Control { case 'image': return array( 'select' => __( 'Select image' ), + 'site_icon' => __( 'Select site icon' ), 'change' => __( 'Change image' ), 'default' => __( 'Default' ), 'remove' => __( 'Remove' ), diff --git a/src/wp-includes/customize/class-wp-customize-site-icon-control.php b/src/wp-includes/customize/class-wp-customize-site-icon-control.php index 4d7bcf525a..bb4681ef62 100644 --- a/src/wp-includes/customize/class-wp-customize-site-icon-control.php +++ b/src/wp-includes/customize/class-wp-customize-site-icon-control.php @@ -47,14 +47,12 @@ class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control */ public function content_template() { ?> - + <# if ( data.label ) { #> + {{ data.label }} + <# } #> + <# if ( data.description ) { #> + {{{ data.description }}} + <# } #> <# if ( data.attachment && data.attachment.id ) { #>
@@ -74,22 +72,19 @@ class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control
<# if ( data.canUpload ) { #> - + <# } #>
<# } else { #>
-
- button_labels['placeholder']; ?> -
+ <# if ( data.canUpload ) { #> + + <# } #>
<# if ( data.defaultAttachment ) { #> <# } #> - <# if ( data.canUpload ) { #> - - <# } #>
<# } #> diff --git a/src/wp-includes/widgets/class-wp-widget-media-gallery.php b/src/wp-includes/widgets/class-wp-widget-media-gallery.php index 54cea50ad9..fc1a5dcf17 100644 --- a/src/wp-includes/widgets/class-wp-widget-media-gallery.php +++ b/src/wp-includes/widgets/class-wp-widget-media-gallery.php @@ -228,7 +228,7 @@ class WP_Widget_Media_Gallery extends WP_Widget_Media { <# } else { #>
-

l10n['no_media_selected'] ); ?>

+
<# } #> diff --git a/src/wp-includes/widgets/class-wp-widget-media.php b/src/wp-includes/widgets/class-wp-widget-media.php index 0c3b599e54..e6146bf8d3 100644 --- a/src/wp-includes/widgets/class-wp-widget-media.php +++ b/src/wp-includes/widgets/class-wp-widget-media.php @@ -411,7 +411,9 @@ abstract class WP_Widget_Media extends WP_Widget {

-
l10n['no_media_selected'] ); ?>
+

@@ -423,9 +425,6 @@ abstract class WP_Widget_Media extends WP_Widget { l10n['replace_media'] ); ?> -

diff --git a/tests/qunit/index.html b/tests/qunit/index.html index 29f53b269c..91ba7c7567 100644 --- a/tests/qunit/index.html +++ b/tests/qunit/index.html @@ -45,7 +45,7 @@ @@ -588,83 +588,87 @@ - - - - - - - + + + + + + - + + + +