diff --git a/src/wp-admin/css/customize-controls.css b/src/wp-admin/css/customize-controls.css index f9ca1d7182..9a95eb1a8f 100644 --- a/src/wp-admin/css/customize-controls.css +++ b/src/wp-admin/css/customize-controls.css @@ -465,18 +465,34 @@ body { margin-bottom: 18px; } +#customize-control-header_image .uploaded button, +#customize-control-header_image .default button { + width: 100%; + padding: 0; + margin: 0; + background: none; + border: none; + color: inherit; + cursor: pointer; + outline: none; +} + +#customize-control-header_image button img { + display: block; +} + /* Header control: current image container */ #customize-control-header_image .current .container { overflow: hidden; -webkit-border-radius: 2px; + border: 1px solid #eee; border-radius: 2px; } #customize-control-header_image .placeholder { width: 100%; position: relative; - background: #262626; text-align: center; cursor: default; } @@ -485,18 +501,49 @@ body { display: none; position: absolute; width: 100%; - height: 18px; - margin-top: -9px; - top: 50%; - color: #eee; + color: #555; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } -/* Header control: overlay "close" button */ +#customize-control-header_image .inner, +#customize-control-header_image .inner .dashicons { + line-height: 20px; + top: 10px; +} +#customize-control-header_image .list .inner, +#customize-control-header_image .list .inner .dashicons { + top: 9px; +} #customize-control-header_image .header-view { position: relative; + width: 100%; + margin-bottom: 5px; } +#customize-control-header_image .header-view:last-child { + margin-bottom: 0px; +} + +/* Convoluted, but 'outline' support isn't good enough yet */ +#customize-control-header_image .header-view:after { + border: 0; +} +#customize-control-header_image .header-view.selected:after { + content: ''; + position: absolute; + top: 0; left: 0; bottom: 0; right: 0; + border: 4px solid #2ea2cc; + border-radius: 2px; +} +#customize-control-header_image .header-view.button.selected { + border: 0; +} + +/* Header control: overlay "close" button */ + #customize-control-header_image .uploaded .header-view .close { font-size: 2em; color: grey; @@ -575,21 +622,10 @@ body { margin-bottom: 9px; } -#customize-control-header_image .choice.random:before { - position: absolute; - content: attr(data-label); - left: 0; - top: 0; -} - #customize-control-header_image .uploaded div:last-child > .choice { margin-bottom: 0; } -#customize-control-header_image .choices hr { - visibility: hidden; -} - #customize-control-header_image img { width: 100%; -webkit-border-radius: 2px; diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index 4a2d44ce1e..2a6a2f3083 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -1272,9 +1272,12 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> public function get_uploaded_header_images() { $header_images = get_uploaded_header_images(); $timestamp_key = '_wp_attachment_custom_header_last_used_' . get_stylesheet(); + $alt_text_key = '_wp_attachment_image_alt'; foreach ( $header_images as &$header_image ) { - $header_image['timestamp'] = get_post_meta( $header_image['attachment_id'], $timestamp_key, true ); + $header_meta = get_post_meta( $header_image['attachment_id'] ); + $header_image['timestamp'] = isset( $header_meta[ $timestamp_key ] ) ? $header_meta[ $timestamp_key ] : ''; + $header_image['alt_text'] = isset( $header_meta[ $alt_text_key ] ) ? $header_meta[ $alt_text_key ] : ''; } return $header_images; diff --git a/src/wp-includes/class-wp-customize-control.php b/src/wp-includes/class-wp-customize-control.php index ac1f07c287..c163247e6d 100644 --- a/src/wp-includes/class-wp-customize-control.php +++ b/src/wp-includes/class-wp-customize-control.php @@ -774,27 +774,28 @@ final class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control
+