Ticket #38768: 38768.diff
File 38768.diff, 920 bytes (added by , 7 years ago) |
---|
-
src/wp-includes/general-template.php
888 888 889 889 // We have a logo. Logo is go. 890 890 if ( $custom_logo_id ) { 891 892 // Get logo alt attribute 893 $image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true); 894 895 // Add site title as alt attribute if the default alt attribute is empty 896 if ( empty( $image_alt ) ) { 897 $image_alt = get_bloginfo( 'name' ); 898 } 899 891 900 $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>', 892 901 esc_url( home_url( '/' ) ), 893 902 wp_get_attachment_image( $custom_logo_id, 'full', false, array( 894 903 'class' => 'custom-logo', 895 904 'itemprop' => 'logo', 905 'alt' => $image_alt, # Add logo alt attribute 896 906 ) ) 897 907 ); 898 908 }