Make WordPress Core


Ignore:
Timestamp:
05/10/2021 06:22:56 PM (4 years ago)
Author:
desrosj
Message:

Network and Sites: Display site icons in the My Sites menu.

This updates the My Sites dropdown menu on multisite installs to display the site icon for each site. When a site icon is not selected, the default WordPress logo will continue showing.

Props rmccue, joemcgill, afercia, audrasjb, desrosj.
Fixes 46657.

File:
1 edited

Legend:

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

    r50801 r50834  
    583583        switch_to_blog( $blog->userblog_id );
    584584
    585         $blavatar = '<div class="blavatar"></div>';
     585        if ( has_site_icon() ) {
     586            $blavatar = sprintf(
     587                '<img class="blavatar" src="%s" srcset="%s 2x" alt="" width="16" height="16" />',
     588                esc_url( get_site_icon_url( 16 ) ),
     589                esc_url( get_site_icon_url( 32 ) )
     590            );
     591        } else {
     592            $blavatar = '<div class="blavatar"></div>';
     593        }
    586594
    587595        $blogname = $blog->blogname;
Note: See TracChangeset for help on using the changeset viewer.