Changeset 40817 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 05/22/2017 08:28:43 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/general-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r40626 r40817 889 889 // We have a logo. Logo is go. 890 890 if ( $custom_logo_id ) { 891 $custom_logo_attr = array( 892 'class' => 'custom-logo', 893 'itemprop' => 'logo', 894 ); 895 896 /* 897 * If the logo alt attribute is empty, get the site title and explicitly 898 * pass it to the attributes used by wp_get_attachment_image(). 899 */ 900 $image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true ); 901 if ( empty( $image_alt ) ) { 902 $custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' ); 903 } 904 905 /* 906 * If the alt attribute is not empty, there's no need to explicitly pass 907 * it because wp_get_attachment_image() already adds the alt attribute. 908 */ 891 909 $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>', 892 910 esc_url( home_url( '/' ) ), 893 wp_get_attachment_image( $custom_logo_id, 'full', false, array( 894 'class' => 'custom-logo', 895 'itemprop' => 'logo', 896 ) ) 911 wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ) 897 912 ); 898 913 }
Note: See TracChangeset
for help on using the changeset viewer.