WordPress.org

Make WordPress Core

Changeset 50834


Ignore:
Timestamp:
05/10/2021 06:22:56 PM (4 months 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.

Location:
trunk/src/wp-includes
Files:
2 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;
  • trunk/src/wp-includes/css/admin-bar.css

    r50028 r50834  
    518518}
    519519
    520 #wpadminbar .quicklinks li .blavatar:before {
    521     content: "\f120";
     520#wpadminbar .quicklinks li img.blavatar,
     521#wpadminbar .quicklinks li div.blavatar:before {
    522522    height: 16px;
    523523    width: 16px;
     524    margin: 0 8px 2px -2px;
     525}
     526
     527#wpadminbar .quicklinks li div.blavatar:before {
     528    content: "\f120";
    524529    display: inline-block;
    525     margin: 0 8px 2px -2px;
    526530}
    527531
Note: See TracChangeset for help on using the changeset viewer.