Make WordPress Core


Ignore:
Timestamp:
09/14/2023 11:23:59 AM (15 months ago)
Author:
spacedmonkey
Message:

Bundled Theme: Implement the_header_image_tag function for enhanced compatibility for older core themes.

The the_header_image_tag function was introduced in WordPress 4.4 as part of [35594]. It is used in all themes created post WordPress 4.4 that supported header images. The function get_header_image_tag continues to get updated with new image features, like lazy loading, async decoding and fetch priority. To ensure our core themes maintain compatibility and benefit from these enhancements, a backward compatibility shim has been applied, integrating the the_header_image_tag function into the following core themes:

  • Twenty Ten
  • Twenty Eleven
  • Twenty Twelve
  • Twenty Fourteen
  • Twenty Sixteen

This change ensures future compatibility and modern image features are applied for header images to these older themes.

Props spacedmonkey, flixos90, mukesh27.
Fixes #58675.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/header.php

    r55276 r56583  
    3737    <div id="site-header">
    3838        <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
    39             <img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />
     39            <?php twentyfourteen_header_image(); ?>
    4040        </a>
    4141    </div>
Note: See TracChangeset for help on using the changeset viewer.