WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/14/2016 06:40:08 PM (4 years ago)
Author:
westonruter
Message:

Customize: Use selective refresh for custom header changes when possible.

  • Use postMessage transport for header image settings by default when video headers are supported, and thus the_custom_header_markup() will necessarily be used (and thus a selective refresh partial will be available).
  • Ensure that the_custom_header_markup() always outputs a container element in the customizer preview even if the header is empty.
  • Ensure that edit shortcut appearing for custom header does not get positioned off-screen.

Props bradyvercher, westonruter.
See #38639.
Fixes #38737.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php

    r39224 r39227  
    1111?>
    1212<div class="custom-header">
    13     <?php
    1413
    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>
    1817
    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' ); ?>
    3319
    3420</div><!-- .custom-header -->
Note: See TracChangeset for help on using the changeset viewer.