Make WordPress Core

Ticket #16434: 16434.flexibility.diff

File 16434.flexibility.diff, 1.3 KB (added by lucaspiller, 9 years ago)

Make the favicon filters more flexible

  • wp-includes/general-template.php

    diff --git wp-includes/general-template.php wp-includes/general-template.php
    index a95da70..49c4e93 100644
    function wp_no_robots() { 
    24452445 * @link http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#rel-icon HTML5 specification link icon.
    24462446 */
    24472447function wp_site_icon() {
    2448         if ( ! has_site_icon() ) {
    2449                 return;
    2450         }
     2448        $meta_tags = array();
    24512449
    2452         $meta_tags = array(
    2453                 sprintf( '<link rel="icon" href="%s" sizes="32x32" />', esc_url( get_site_icon_url( null, 32 ) ) ),
    2454                 sprintf( '<link rel="apple-touch-icon-precomposed" href="%s">', esc_url( get_site_icon_url( null, 180 ) ) ),
    2455                 sprintf( '<meta name="msapplication-TileImage" content="%s">', esc_url( get_site_icon_url( null, 270 ) ) ),
    2456         );
     2450        if ( has_site_icon() ) {
     2451                array_merge($meta_tags, array(
     2452                        sprintf( '<link rel="icon" href="%s" sizes="32x32" />', esc_url( get_site_icon_url( null, 32 ) ) ),
     2453                        sprintf( '<link rel="apple-touch-icon-precomposed" href="%s">', esc_url( get_site_icon_url( null, 180 ) ) ),
     2454                        sprintf( '<meta name="msapplication-TileImage" content="%s">', esc_url( get_site_icon_url( null, 270 ) ) ),
     2455                ));
     2456        }
    24572457
    24582458        /**
    24592459         * Filters the site icon meta tags, so Plugins can add their own.