show_admin_bar WordPress Filter Hook

The show_admin_bar Wordpress hook is used to determine whether or not the admin bar should be displayed on the front end of the site. The admin bar is a toolbar that is displayed at the top of the page when an administrator is logged in. This hook can be used to hide the admin bar from non-administrators, or to show the admin bar only to certain users.

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.


Top ↑

Parameters

$show_admin_bar

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


Top ↑

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.


Top ↑

Source

File: wp-includes/admin-bar.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.