WordPress.org

Make WordPress Core

Ticket #46657: 46657.4.diff

File 46657.4.diff, 1.6 KB (added by rmccue, 17 months ago)

Add alt and update CSS

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

    diff --git src/wp-includes/admin-bar.php src/wp-includes/admin-bar.php
    index 6600c651df..d8cb66f3d0 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 = '<img class="blavatar" src="' . esc_url( $icon_url ) . '" alt="" width="16" height="16" />';
     575                } else {
     576                        $blavatar = '<div class="blavatar"></div>';
     577                }
     578
     579                /**
     580                 * Filter the icon for a site in the My Sites dropdown menu.
     581                 *
     582                 * @param string $blavatar Site icon markup.
     583                 * @param stdClass $blog Site being displayed.
     584                 */
     585                $blavatar = apply_filters( 'admin_bar_my_sites_site_icon', $blavatar, $blog );
    573586
    574587                $blogname = $blog->blogname;
    575588
  • 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..376d2f0049 100644
    html:lang(he-il) .rtl #wpadminbar * { 
    517517        color: #00b9eb;
    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         display: inline-block;
    525524        margin: 6px 8px 0 -2px;
    526525}
    527526
     527#wpadminbar .quicklinks li div.blavatar:before {
     528        content: "\f120";
     529        display: inline-block;
     530}
     531
    528532#wpadminbar #wp-admin-bar-appearance {
    529533        margin-top: -12px;
    530534}