Ticket #37011: 37011.2.diff
File 37011.2.diff, 1.6 KB (added by , 5 years ago) |
---|
-
src/wp-includes/general-template.php
939 939 } 940 940 941 941 /** 942 * Returns a custom logo, linked to home .942 * Returns a custom logo, linked to home when on another page. 943 943 * 944 944 * @since 4.5.0 945 * @since 5.5.0 Removed link on the home or front page. 945 946 * 946 947 * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog. 947 948 * @return string Custom logo markup. … … 976 977 * If the alt attribute is not empty, there's no need to explicitly pass 977 978 * it because wp_get_attachment_image() already adds the alt attribute. 978 979 */ 979 $html = sprintf( 980 '<a href="%1$s" class="custom-logo-link" rel="home">%2$s</a>', 981 esc_url( home_url( '/' ) ), 982 wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ) 983 ); 980 if ( is_front_page() ) { 981 // If on the home or front page, don’t link the logo to home. 982 $html = sprintf( 983 '<span class="custom-logo-link">%1$s</span>', 984 wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ) 985 ); 986 } else { 987 $html = sprintf( 988 '<a href="%1$s" class="custom-logo-link" rel="home">%2$s</a>', 989 esc_url( home_url( '/' ) ), 990 wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ) 991 ); 992 } 984 993 } elseif ( is_customize_preview() ) { 985 994 // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview). 986 995 $html = sprintf(