Make WordPress Core

Ticket #38942: 38942.1.diff

File 38942.1.diff, 640 bytes (added by audrasjb, 3 years ago)

Themes: Introduce get_header_image_tag_attributes hook to filter the list of header image attributes.

  • src/wp-includes/theme.php

    diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php
    index 384c056404..b997312908 100644
    a b function get_header_image_tag( $attr = array() ) { 
    12341234                }
    12351235        }
    12361236
     1237        /*
     1238         * Filters the list of header image attributes.
     1239         *
     1240         * @since 5.9.0
     1241         *
     1242         * @param array  $attr   Array of the attributes for the image tag.
     1243         * @param object $header The custom header object returned by 'get_custom_header()'.
     1244         */
     1245        $attr = apply_filters( 'get_header_image_tag_attributes', $attr, $header );
     1246
    12371247        $attr = array_map( 'esc_attr', $attr );
    12381248        $html = '<img';
    12391249