Ticket #37011: 37011.3.alt.diff
File 37011.3.alt.diff, 2.3 KB (added by , 4 years ago) |
---|
-
src/wp-includes/general-template.php
940 940 } 941 941 942 942 /** 943 * Returns a custom logo, linked to home .943 * Returns a custom logo, linked to home. 944 944 * 945 945 * @since 4.5.0 946 946 947 * 947 948 * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog. 948 949 * @return string Custom logo markup. … … 965 966 ); 966 967 967 968 /* 968 * If the logo alt attribute is empty, get the site title and explicitly 969 * pass itto the attributes used by wp_get_attachment_image().969 * If the logo alt attribute is empty, get the site title and explicitly 970 * to the attributes used by wp_get_attachment_image(). 970 971 */ 971 972 $image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true ); 972 973 if ( empty( $image_alt ) ) { … … 974 975 } 975 976 976 977 /* 977 * If the alt attribute is not empty, there's no need to explicitly pass 978 * itbecause wp_get_attachment_image() already adds the alt attribute.978 * If the alt attribute is not empty, there's no need to explicitly pass 979 * because wp_get_attachment_image() already adds the alt attribute. 979 980 */ 980 $html = sprintf( 981 '<a href="%1$s" class="custom-logo-link" rel="home">%2$s</a>', 982 esc_url( home_url( '/' ) ), 983 wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ) 984 ); 981 $image = wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ); 982 983 if ( is_front_page() ) { 984 // If on the home page, don't link the logo to home. 985 $html = sprintf( 986 '<span class="custom-logo-link">%1$s</span>', 987 $image 988 ); 989 } else { 990 $html = sprintf( 991 '<a href="%1$s" class="custom-logo-link" rel="home">%2$s</a>', 992 esc_url( home_url( '/' ) ), 993 $image 994 ); 995 } 985 996 } elseif ( is_customize_preview() ) { 986 997 // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview). 987 998 $html = sprintf( … … 1007 1018 } 1008 1019 1009 1020 /** 1010 * Displays a custom logo, linked to home .1021 * Displays a custom logo, linked to home. 1011 1022 * 1012 1023 * @since 4.5.0 1013 1024 *