Changeset 53100
- Timestamp:
- 04/07/2022 10:12:34 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/admin-bar.php
r53060 r53100 612 612 ); 613 613 614 /** 615 * Filters whether to show the site icons in toolbar. 616 * 617 * Returning false to this hook is the recommended way to hide site icons in the toolbar. 618 * A truthy return may have negative performance impact on large multisites. 619 * 620 * @since 6.0.0 621 * 622 * @param bool $show_site_icons Whether site icons should be shown in the toolbar. Default true. 623 */ 624 $show_site_icons = apply_filters( 'wp_admin_bar_show_site_icons', true ); 625 614 626 foreach ( (array) $wp_admin_bar->user->blogs as $blog ) { 615 627 switch_to_blog( $blog->userblog_id ); 616 628 617 if ( has_site_icon() ) {629 if ( true === $show_site_icons && has_site_icon() ) { 618 630 $blavatar = sprintf( 619 '<img class="blavatar" src="%s" srcset="%s 2x" alt="" width="16" height="16" />',631 '<img class="blavatar" src="%s" srcset="%s 2x" alt="" width="16" height="16"%s />', 620 632 esc_url( get_site_icon_url( 16 ) ), 621 esc_url( get_site_icon_url( 32 ) ) 633 esc_url( get_site_icon_url( 32 ) ), 634 ( wp_lazy_loading_enabled( 'img', 'site_icon_in_toolbar' ) ? ' loading="lazy"' : '' ) 622 635 ); 623 636 } else {
Note: See TracChangeset
for help on using the changeset viewer.