apply_filters( 'wp_admin_bar_show_site_icons', bool $show_site_icons )
- Since
- 6.0.0
Filters whether to show the site icons in toolbar.
Description
Returning false to this hook is the recommended way to hide site icons in the toolbar.
A truthy return may have negative performance impact on large multisites.
Compatibility
- WordPress
- since 6.0.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$show_site_iconsbool- Whether site icons should be shown in the toolbar. Default true.
Where this hook fires · 1
wp-includes/admin-bar.php:682wp_admin_bar_my_sites_menu()
Source code
* A truthy return may have negative performance impact on large multisites. * * @since 6.0.0 * * @param bool $show_site_icons Whether site icons should be shown in the toolbar. Default true. */ $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(Changelog
Introduced in 6.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.