Ticket #36640: custom-logo-imgattr_filter.patch
| File custom-logo-imgattr_filter.patch, 1.1 KB (added by , 10 years ago) |
|---|
-
src/wp-includes/general-template.php
879 879 880 880 // We have a logo. Logo is go. 881 881 if ( $custom_logo_id ) { 882 883 /** 884 * Filter the custom logo image tag attributes. 885 * 886 * @param string $attr Custom logo image tag attributes. 887 * @param string $blog_id ID of the blog in question. 888 * @param string $custom_logo_id Custom logo attachment ID. 889 */ 890 $attr = apply_filters( 'get_custom_logo_imgattr', array(), $blog_id, $custom_logo_id ); 891 892 if ( empty( $attr['class'] ) ) { 893 $attr['class'] = 'custom-logo'; 894 } else { 895 $attr['class'] .= ' custom-logo'; 896 } 897 898 $attr['itemprop'] = 'logo'; 899 882 900 $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>', 883 901 esc_url( home_url( '/' ) ), 884 wp_get_attachment_image( $custom_logo_id, 'full', false, array( 885 'class' => 'custom-logo', 886 'itemprop' => 'logo', 887 ) ) 902 wp_get_attachment_image( $custom_logo_id, 'full', false, $attr ) 888 903 ); 889 904 } 890 905
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)