apply_filters( 'show_admin_bar', bool $show_admin_bar )

Filters whether to show the admin bar.

Description

Returning false to this hook is the recommended way to hide the admin bar. The user’s display preference is used for logged in users.

Parameters

$show_admin_bar

(bool) Whether the admin bar should be shown. Default false.

More Information

The show_admin_bar filter toggles the display status of the Toolbar for the front side of your website (you cannot turn off the toolbar on the WordPress dashboard anymore).

This filter is part of the function is_admin_bar_showing().

Note: The Admin Bar is replaced with the Toolbar since WordPress Version 3.3.

Source

File: wp-includes/admin-bar.php

View on Trac

Changelog

Version Description
3.1.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/show_admin_bar