$show_site_icons =
apply_filters( 'wp_admin_bar_show_site_icons', true
);
foreach ( (array) $wp_admin_bar->user->blogs
as $blog ) { switch_to_blog( $blog->userblog_id
);
if ( true ===
$show_site_icons &&
has_site_icon() ) { $blavatar =
sprintf( '<img class="blavatar" src="%s" srcset="%s 2x" alt="" width="16" height="16"%s />',
esc_url( get_site_icon_url( 16
) ),
esc_url( get_site_icon_url( 32
) ),
( wp_lazy_loading_enabled( 'img', 'site_icon_in_toolbar'
) ? ' loading="lazy"' : ''
) );
} else { $blavatar = '<div class="blavatar"></div>';
} $blogname =
$blog->blogname;
if ( !
$blogname ) { $blogname =
preg_replace( '#^(https?://)?(www.)?#', '',
get_home_url() );
}