WordPress.org

Make WordPress Core

Changeset 39317


Ignore:
Timestamp:
11/19/16 04:54:14 (9 months ago)
Author:
helen
Message:

Twenty Seventeen: Avoid an undefined index notice after [39291].

props westonruter.
see #38847.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/functions.php

    r39294 r39317  
    436436 */ 
    437437function twentyseventeen_header_image_tag( $html, $header, $attr ) { 
    438     return str_replace( $attr['sizes'], '100vw', $html ); 
    439 } 
    440 add_filter ( 'get_header_image_tag', 'twentyseventeen_header_image_tag', 10, 3 ); 
     438    if ( isset( $attr['sizes'] ) ) { 
     439        $html = str_replace( $attr['sizes'], '100vw', $html ); 
     440    } 
     441    return $html; 
     442} 
     443add_filter( 'get_header_image_tag', 'twentyseventeen_header_image_tag', 10, 3 ); 
    441444 
    442445/** 
Note: See TracChangeset for help on using the changeset viewer.