diff --git src/wp-content/themes/twentyfourteen/header.php src/wp-content/themes/twentyfourteen/header.php
index 0a4953c..9f43e48 100644
--- src/wp-content/themes/twentyfourteen/header.php
+++ src/wp-content/themes/twentyfourteen/header.php
@@ -32,7 +32,7 @@
>
-
+
diff --git src/wp-content/themes/twentyfourteen/inc/customizer.php src/wp-content/themes/twentyfourteen/inc/customizer.php
index 9540855..3928915 100644
--- src/wp-content/themes/twentyfourteen/inc/customizer.php
+++ src/wp-content/themes/twentyfourteen/inc/customizer.php
@@ -19,8 +19,6 @@ function twentyfourteen_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
- $wp_customize->get_setting( 'header_image' )->transport = 'postMessage';
- $wp_customize->get_setting( 'header_image_data' )->transport = 'postMessage';
if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( 'blogname', array(
diff --git src/wp-content/themes/twentyseventeen/inc/customizer.php src/wp-content/themes/twentyseventeen/inc/customizer.php
index 6e2db28..5963f79 100644
--- src/wp-content/themes/twentyseventeen/inc/customizer.php
+++ src/wp-content/themes/twentyseventeen/inc/customizer.php
@@ -16,8 +16,6 @@ function twentyseventeen_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
- $wp_customize->get_setting( 'header_image' )->transport = 'postMessage';
- $wp_customize->get_setting( 'header_image_data' )->transport = 'postMessage';
$wp_customize->selective_refresh->add_partial( 'blogname', array(
'selector' => '.site-title a',
diff --git src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php
index de03a60..5dea9d8 100644
--- src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php
+++ src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php
@@ -10,26 +10,11 @@
?>
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index 150b123..81bd4d1 100644
--- src/wp-includes/class-wp-customize-manager.php
+++ src/wp-includes/class-wp-customize-manager.php
@@ -3462,6 +3462,12 @@ final class WP_Customize_Manager {
'theme_supports' => 'custom-header',
) ) );
+ // Switch image settings to post message when video support is enabled.
+ if ( current_theme_supports( 'custom-header', 'video' ) ) {
+ $this->get_setting( 'header_image' )->transport = 'postMessage';
+ $this->get_setting( 'header_image_data' )->transport = 'postMessage';
+ }
+
$this->add_control( new WP_Customize_Media_Control( $this, 'header_video', array(
'theme_supports' => array( 'custom-header', 'video' ),
'label' => __( 'Header Video' ),
diff --git src/wp-includes/css/customize-preview.css src/wp-includes/css/customize-preview.css
index c72675e..e099b30 100644
--- src/wp-includes/css/customize-preview.css
+++ src/wp-includes/css/customize-preview.css
@@ -74,6 +74,9 @@
0 1px 1px #006799,
-1px 0 1px #006799;
}
+.wp-custom-header .customize-partial-edit-shortcut button {
+ left: 2px
+}
.customize-partial-edit-shortcut button svg {
fill: #fff;
diff --git src/wp-includes/theme.php src/wp-includes/theme.php
index bf1c55c..865f851 100644
--- src/wp-includes/theme.php
+++ src/wp-includes/theme.php
@@ -1410,13 +1410,15 @@ function has_custom_header() {
/**
* Retrieve the markup for a custom header.
*
+ * The container div will always be returned in the Customizer preview.
+ *
* @since 4.7.0
*
- * @return string|false The markup for a custom header on success. False if not.
+ * @return string The markup for a custom header on success.
*/
function get_custom_header_markup() {
- if ( ! has_custom_header() ) {
- return false;
+ if ( ! has_custom_header() && ! is_customize_preview() ) {
+ return '';
}
return sprintf(
@@ -1428,15 +1430,19 @@ function get_custom_header_markup() {
/**
* Print the markup for a custom header.
*
+ * A container div will always be printed in the Customizer preview.
+ *
* @since 4.7.0
*/
function the_custom_header_markup() {
- if ( ! $custom_header = get_custom_header_markup() ) {
+ $custom_header = get_custom_header_markup();
+ if ( empty( $custom_header ) ) {
return;
}
+
echo $custom_header;
- if ( has_header_video() && is_front_page() ) {
+ if ( is_front_page() && ( has_header_video() || is_customize_preview() ) ) {
wp_enqueue_script( 'wp-custom-header' );
wp_localize_script( 'wp-custom-header', '_wpCustomHeaderSettings', get_header_video_settings() );
}