WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/29/2015 12:57:35 PM (4 years ago)
Author:
obenland
Message:

Introducing Site Icon, favicon management for WordPress.

This v1 marries Jetpack's Site Icon module with the Media Modal, reusing code
from the Custom Header admin. For now, the core-provided icons will be limited
to a favicon, an iOS app icon, and a Windows tile icon, leaving .ico support
and additional icons to plugins to add.

Props obenland, tyxla, flixos90, jancbeck, markjaquith, scruffian.
See #16434.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/feed.php

    r32940 r32994  
    589589
    590590/**
     591 * Display Site Icon in atom feeds.
     592 *
     593 * @since 4.3.0
     594 */
     595function atom_site_icon() {
     596    $url = get_site_icon_url( null, 32 );
     597    if ( $url ) {
     598        echo "<icon>$url</icon>\n";
     599    }
     600}
     601
     602/**
     603 * Display Site Icon in RSS2.
     604 *
     605 * @since 4.3.0
     606 */
     607function rss2_site_icon() {
     608    $rss_title = get_wp_title_rss();
     609    if ( empty( $rss_title ) ) {
     610        $rss_title = get_bloginfo_rss( 'name' );
     611    }
     612
     613    $url = get_site_icon_url( null, 32 );
     614    if ( $url ) {
     615        echo '
     616<image>
     617    <url>' . convert_chars( $url ) . '</url>
     618    <title>' . $rss_title . '</title>
     619    <link>' . get_bloginfo_rss( 'url' ) . '</link>
     620    <width>32</width>
     621    <height>32</height>
     622</image> ' . "\n";
     623    }
     624}
     625
     626/**
    591627 * Display the link for the currently displayed feed in a XSS safe way.
    592628 *
Note: See TracChangeset for help on using the changeset viewer.