Changeset 48039
- Timestamp:
- 06/14/2020 10:00:47 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r47808 r48039 941 941 942 942 /** 943 * Returns a custom logo, linked to home .943 * Returns a custom logo, linked to home when on another page. 944 944 * 945 945 * @since 4.5.0 946 * @since 5.5.0 Removed the link on the home page. 946 947 * 947 948 * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog. … … 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 pass it 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 ); … … 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 it 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). … … 1008 1019 1009 1020 /** 1010 * Displays a custom logo, linked to home .1021 * Displays a custom logo, linked to home when on another page. 1011 1022 * 1012 1023 * @since 4.5.0
Note: See TracChangeset
for help on using the changeset viewer.