Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_admin_bar_show_site_icons

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
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
626      foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
627           switch_to_blog( $blog->userblog_id );
628
629           if ( true === $show_site_icons && has_site_icon() ) {
630                $blavatar = sprintf(
631                     '<img class="blavatar" src="%s" srcset="%s 2x" alt="" width="16" height="16"%s />',
632                     esc_url( get_site_icon_url( 16 ) ),
633                     esc_url( get_site_icon_url( 32 ) ),