Ticket #38377: 38377.0.diff
File 38377.0.diff, 2.7 KB (added by , 7 years ago) |
---|
-
src/wp-admin/js/customize-controls.js
diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js index e354d0d..2cd47f1 100644
3336 3336 * @param {object} attachment 3337 3337 */ 3338 3338 setImageFromAttachment: function( attachment ) { 3339 var sizes = [ 'site_icon-32', 'thumbnail', 'full' ], 3339 var sizes = [ 'site_icon-32', 'thumbnail', 'full' ], link, 3340 3340 icon; 3341 3341 3342 3342 _.each( sizes, function( size ) { … … 3350 3350 // Set the Customizer setting; the callback takes care of rendering. 3351 3351 this.setting( attachment.id ); 3352 3352 3353 if ( ! icon ) { 3354 return; 3355 } 3356 3353 3357 // Update the icon in-browser. 3354 $( 'link[sizes="32x32"]' ).attr( 'href', icon.url ); 3358 link = $( 'link[rel="icon"][sizes="32x32"]' ); 3359 link.attr( 'href', icon.url ); 3355 3360 }, 3356 3361 3357 3362 /** … … 3368 3373 this.params.attachment = {}; 3369 3374 this.setting( '' ); 3370 3375 this.renderContent(); // Not bound to setting change when emptying. 3371 $( 'link[rel="icon"] ' ).attr( 'href', '' );3376 $( 'link[rel="icon"][sizes="32x32"]' ).attr( 'href', '/favicon.ico' ); // Set to default. 3372 3377 } 3373 3378 }); 3374 3379 -
src/wp-includes/general-template.php
diff --git src/wp-includes/general-template.php src/wp-includes/general-template.php index 5b36272..e91db54 100644
function wp_site_icon() { 2780 2780 return; 2781 2781 } 2782 2782 2783 $meta_tags = array( 2784 sprintf( '<link rel="icon" href="%s" sizes="32x32" />', esc_url( get_site_icon_url( 32 ) ) ), 2785 sprintf( '<link rel="icon" href="%s" sizes="192x192" />', esc_url( get_site_icon_url( 192 ) ) ), 2786 sprintf( '<link rel="apple-touch-icon-precomposed" href="%s" />', esc_url( get_site_icon_url( 180 ) ) ), 2787 sprintf( '<meta name="msapplication-TileImage" content="%s" />', esc_url( get_site_icon_url( 270 ) ) ), 2788 ); 2783 $meta_tags = array(); 2784 $icon_32 = get_site_icon_url( 32 ); 2785 if ( empty( $icon_32 ) && is_customize_preview() ) { 2786 $icon_32 = '/favicon.ico'; // Serve default favicon URL in customizer so element can be updated for preview. 2787 } 2788 if ( $icon_32 ) { 2789 $meta_tags[] = sprintf( '<link rel="icon" href="%s" sizes="32x32" />', esc_url( $icon_32 ) ); 2790 } 2791 $icon_192 = get_site_icon_url( 192 ); 2792 if ( $icon_192 ) { 2793 $meta_tags[] = sprintf( '<link rel="icon" href="%s" sizes="192x192" />', esc_url( $icon_192 ) ); 2794 } 2795 $icon_180 = get_site_icon_url( 180 ); 2796 if ( $icon_180 ) { 2797 $meta_tags[] = sprintf( '<link rel="apple-touch-icon-precomposed" href="%s" />', esc_url( $icon_180 ) ); 2798 } 2799 $icon_270 = get_site_icon_url( 270 ); 2800 if ( $icon_270 ) { 2801 $meta_tags[] = sprintf( '<meta name="msapplication-TileImage" content="%s" />', esc_url( $icon_270 ) ); 2802 } 2789 2803 2790 2804 /** 2791 2805 * Filters the site icon meta tags, so Plugins can add their own.