WordPress.org

Make WordPress Core

Ticket #46657: 46657.diff

File 46657.diff, 1.2 KB (added by rmccue, 14 months ago)

Initial proof-of-concept

  • src/wp-includes/admin-bar.php

    diff --git src/wp-includes/admin-bar.php src/wp-includes/admin-bar.php
    index 6600c651df..58c792817a 100644
    function wp_admin_bar_my_sites_menu( $wp_admin_bar ) { 
    569569        foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
    570570                switch_to_blog( $blog->userblog_id );
    571571
    572                 $blavatar = '<div class="blavatar"></div>';
     572                $icon_url = get_site_icon_url( 16 );
     573                if ( $icon_url ) {
     574                        $blavatar = sprintf(
     575                                '<img src="%s" class="blavatar" width="16" height="16" />',
     576                                $icon_url
     577                        );
     578                } else {
     579                        $blavatar = '<div class="blavatar"></div>';
     580                }
    573581
    574582                $blogname = $blog->blogname;
    575583
  • src/wp-includes/css/admin-bar.css

    diff --git src/wp-includes/css/admin-bar.css src/wp-includes/css/admin-bar.css
    index ae35741489..f6dae56189 100644
    html:lang(he-il) .rtl #wpadminbar * { 
    511511        color: #eee;
    512512}
    513513
     514#wpadminbar .quicklinks li img.blavatar {
     515        height: 16px;
     516        width: 16px;
     517        display: inline-block;
     518        margin: 6px 8px 0 -2px;
     519}
     520
    514521#wpadminbar .quicklinks li a:hover .blavatar,
    515522#wpadminbar .quicklinks li a:focus .blavatar,
    516523#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar {