diff --git a/src/wp-admin/css/customize-controls.css b/src/wp-admin/css/customize-controls.css
index 7c7c121b67..c3bcee249b 100644
a
|
b
|
p.customize-section-description { |
1376 | 1376 | } |
1377 | 1377 | |
1378 | 1378 | .customize-control .attachment-media-view .placeholder, |
| 1379 | .customize-control .attachment-media-view .placeholder-button, |
1379 | 1380 | .customize-control-header .placeholder { |
1380 | 1381 | width: 100%; |
1381 | 1382 | position: relative; |
… |
… |
p.customize-section-description { |
1387 | 1388 | line-height: 20px; |
1388 | 1389 | } |
1389 | 1390 | |
| 1391 | .customize-control .attachment-media-view .placeholder-button { |
| 1392 | cursor: pointer; |
| 1393 | background-color: #edeff0; |
| 1394 | } |
| 1395 | |
| 1396 | .customize-control .attachment-media-view .placeholder-button:hover { |
| 1397 | background-color: #f8f9f9; |
| 1398 | } |
| 1399 | |
1390 | 1400 | .customize-control-header .inner { |
1391 | 1401 | display: none; |
1392 | 1402 | position: absolute; |
diff --git a/src/wp-admin/css/widgets.css b/src/wp-admin/css/widgets.css
index b503a084c5..95acaf6e37 100644
a
|
b
|
|
84 | 84 | margin-right: 8px; |
85 | 85 | } |
86 | 86 | |
| 87 | .media-widget-control .attachment-media-view .placeholder-button, |
87 | 88 | .media-widget-control .placeholder { |
88 | 89 | border: 1px dashed #b4b9be; |
89 | 90 | box-sizing: border-box; |
… |
… |
|
95 | 96 | width: 100%; |
96 | 97 | } |
97 | 98 | |
| 99 | .media-widget-control .attachment-media-view .placeholder-button { |
| 100 | cursor: pointer; |
| 101 | background-color: #edeff0; |
| 102 | } |
| 103 | |
| 104 | .media-widget-control .attachment-media-view .placeholder-button:hover { |
| 105 | background-color: #f8f9f9; |
| 106 | } |
| 107 | |
98 | 108 | .media-widget-control .media-widget-preview { |
99 | 109 | background: transparent; |
100 | 110 | 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 338324fd36..56a3aa25b7 100644
a
|
b
|
class WP_Customize_Media_Control extends WP_Customize_Control { |
188 | 188 | </div> |
189 | 189 | <# } else { #> |
190 | 190 | <div class="attachment-media-view"> |
191 | | <div class="placeholder"> |
192 | | {{ data.button_labels.placeholder }} |
193 | | </div> |
| 191 | <# if ( data.canUpload ) { #> |
| 192 | <button type="button" class="upload-button placeholder-button" id="{{ selectButtonId }}" {{{ describedByAttr }}}>{{ data.button_labels.select }}</button> |
| 193 | <# } #> |
194 | 194 | <div class="actions"> |
195 | 195 | <# if ( data.defaultAttachment ) { #> |
196 | | <button type="button" class="button default-button">{{ data.button_labels['default'] }}</button> |
197 | | <# } #> |
198 | | <# if ( data.canUpload ) { #> |
199 | | <button type="button" class="button upload-button" id="{{ selectButtonId }}" {{{ describedByAttr }}}>{{ data.button_labels.select }}</button> |
| 196 | <button type="button" class="button default-button">{{ data.button_labels['default'] }}</button> |
200 | 197 | <# } #> |
201 | 198 | </div> |
202 | 199 | </div> |
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..1238fc5774 100644
a
|
b
|
class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control |
80 | 80 | </div> |
81 | 81 | <# } else { #> |
82 | 82 | <div class="attachment-media-view"> |
83 | | <div class="placeholder"> |
84 | | <?php echo $this->button_labels['placeholder']; ?> |
85 | | </div> |
| 83 | <# if ( data.canUpload ) { #> |
| 84 | <button type="button" class="upload-button placeholder-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button> |
| 85 | <# } #> |
86 | 86 | <div class="actions"> |
87 | 87 | <# if ( data.defaultAttachment ) { #> |
88 | 88 | <button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button> |
89 | 89 | <# } #> |
90 | | <# if ( data.canUpload ) { #> |
91 | | <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button> |
92 | | <# } #> |
93 | 90 | </div> |
94 | 91 | </div> |
95 | 92 | <# } #> |
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 652d8d0723..0f8030e1ea 100644
a
|
b
|
class WP_Widget_Media_Gallery extends WP_Widget_Media { |
175 | 175 | parent::render_control_template_scripts(); |
176 | 176 | ?> |
177 | 177 | <script type="text/html" id="tmpl-wp-media-widget-gallery-preview"> |
178 | | <# var describedById = 'describedBy-' + String( Math.random() ); #> |
179 | 178 | <# if ( data.ids.length ) { #> |
180 | 179 | <div class="gallery media-widget-gallery-preview"> |
181 | 180 | <# _.each( data.ids, function( id, index ) { #> |
… |
… |
class WP_Widget_Media_Gallery extends WP_Widget_Media { |
205 | 204 | </div> |
206 | 205 | <# } else { #> |
207 | 206 | <div class="attachment-media-view"> |
208 | | <p class="placeholder"><?php echo esc_html( $this->l10n['no_media_selected'] ); ?></p> |
| 207 | <button type="button" class="placeholder placeholder-button"><?php echo esc_html( $this->l10n['add_media'] ); ?></button> |
209 | 208 | </div> |
210 | 209 | <# } #> |
211 | 210 | </script> |
diff --git a/src/wp-includes/widgets/class-wp-widget-media.php b/src/wp-includes/widgets/class-wp-widget-media.php
index 0c3b599e54..3912b79e37 100644
a
|
b
|
abstract class WP_Widget_Media extends WP_Widget { |
411 | 411 | </p> |
412 | 412 | <div class="media-widget-preview <?php echo esc_attr( $this->id_base ); ?>"> |
413 | 413 | <div class="attachment-media-view"> |
414 | | <div class="placeholder"><?php echo esc_html( $this->l10n['no_media_selected'] ); ?></div> |
| 414 | <button type="button" class="select-media placeholder-button not-selected"> |
| 415 | <?php echo esc_html( $this->l10n['add_media'] ); ?> |
| 416 | </button> |
415 | 417 | </div> |
416 | 418 | </div> |
417 | 419 | <p class="media-widget-buttons"> |
… |
… |
abstract class WP_Widget_Media extends WP_Widget { |
423 | 425 | <?php echo esc_html( $this->l10n['replace_media'] ); ?> |
424 | 426 | </button> |
425 | 427 | <?php endif; ?> |
426 | | <button type="button" class="button select-media not-selected"> |
427 | | <?php echo esc_html( $this->l10n['add_media'] ); ?> |
428 | | </button> |
429 | 428 | </p> |
430 | 429 | <div class="media-widget-fields"> |
431 | 430 | </div> |