Changeset 48283
- Timestamp:
- 07/03/2020 12:56:43 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r48277 r48283 982 982 ); 983 983 984 /* 985 * If the logo alt attribute is empty, get the site title and explicitly pass it 986 * to the attributes used by wp_get_attachment_image(). 987 */ 988 $image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true ); 989 if ( empty( $image_alt ) ) { 990 $custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' ); 984 if ( is_front_page() ) { 985 /* 986 * If on the home page, set the logo alt attribute to an empty string, 987 * as the image is decorative and doesn't need its purpose to be described. 988 */ 989 $custom_logo_attr['alt'] = ''; 990 } else { 991 /* 992 * If the logo alt attribute is empty, get the site title and explicitly pass it 993 * to the attributes used by wp_get_attachment_image(). 994 */ 995 $image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true ); 996 if ( empty( $image_alt ) ) { 997 $custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' ); 998 } 991 999 } 992 1000
Note: See TracChangeset
for help on using the changeset viewer.