Changeset 39227
- Timestamp:
- 11/14/2016 06:40:08 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyseventeen/inc/customizer.php
r39078 r39227 17 17 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 18 18 $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; 19 $wp_customize->get_setting( 'header_image' )->transport = 'postMessage';20 $wp_customize->get_setting( 'header_image_data' )->transport = 'postMessage';21 19 22 20 $wp_customize->selective_refresh->add_partial( 'blogname', array( -
trunk/src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php
r39224 r39227 11 11 ?> 12 12 <div class="custom-header"> 13 <?php14 13 15 // Check if Custom Header image has been added.16 if ( has_custom_header() ) :17 ?>14 <div class="custom-header-image"> 15 <?php the_custom_header_markup(); ?> 16 </div> 18 17 19 <?php // Output the full custom header - video and/or image fallback. ?> 20 <div class="custom-header-image"> 21 <?php the_custom_header_markup(); ?> 22 </div> 23 <?php get_template_part( 'template-parts/header/site', 'branding' ); ?> 24 25 <?php else : ?> 26 27 <?php // Otherwise, show a blank header. ?> 28 <div class="custom-header-simple"> 29 <?php get_template_part( 'template-parts/header/site', 'branding' ); ?> 30 </div><!-- .custom-header-simple --> 31 32 <?php endif; ?> 18 <?php get_template_part( 'template-parts/header/site', 'branding' ); ?> 33 19 34 20 </div><!-- .custom-header --> -
trunk/src/wp-includes/class-wp-customize-manager.php
r39205 r39227 3463 3463 ) ) ); 3464 3464 3465 /* 3466 * Switch image settings to postMessage when video support is enabled since 3467 * it entails that the_custom_header_markup() will be used, and thus selective 3468 * refresh can be utilized. 3469 */ 3470 if ( current_theme_supports( 'custom-header', 'video' ) ) { 3471 $this->get_setting( 'header_image' )->transport = 'postMessage'; 3472 $this->get_setting( 'header_image_data' )->transport = 'postMessage'; 3473 } 3474 3465 3475 $this->add_control( new WP_Customize_Media_Control( $this, 'header_video', array( 3466 3476 'theme_supports' => array( 'custom-header', 'video' ), -
trunk/src/wp-includes/css/customize-preview.css
r39202 r39227 75 75 -1px 0 1px #006799; 76 76 } 77 .wp-custom-header .customize-partial-edit-shortcut button { 78 left: 2px 79 } 77 80 78 81 .customize-partial-edit-shortcut button svg { -
trunk/src/wp-includes/theme.php
r39209 r39227 1411 1411 * Retrieve the markup for a custom header. 1412 1412 * 1413 * The container div will always be returned in the Customizer preview. 1414 * 1413 1415 * @since 4.7.0 1414 1416 * 1415 * @return string |false The markup for a custom header on success. False if not.1417 * @return string The markup for a custom header on success. 1416 1418 */ 1417 1419 function get_custom_header_markup() { 1418 if ( ! has_custom_header() ) {1419 return false;1420 if ( ! has_custom_header() && ! is_customize_preview() ) { 1421 return ''; 1420 1422 } 1421 1423 … … 1429 1431 * Print the markup for a custom header. 1430 1432 * 1433 * A container div will always be printed in the Customizer preview. 1434 * 1431 1435 * @since 4.7.0 1432 1436 */ 1433 1437 function the_custom_header_markup() { 1434 if ( ! $custom_header = get_custom_header_markup() ) { 1438 $custom_header = get_custom_header_markup(); 1439 if ( empty( $custom_header ) ) { 1435 1440 return; 1436 1441 } 1442 1437 1443 echo $custom_header; 1438 1444 1439 if ( has_header_video() && is_front_page() ) {1445 if ( is_front_page() && ( has_header_video() || is_customize_preview() ) ) { 1440 1446 wp_enqueue_script( 'wp-custom-header' ); 1441 1447 wp_localize_script( 'wp-custom-header', '_wpCustomHeaderSettings', get_header_video_settings() );
Note: See TracChangeset
for help on using the changeset viewer.