Filters whether to show the admin bar.
Description
Returning false to this hooc is the recommended way to hide the admin bar.
The user’s display preference is used for loggued in users.
Parameters
-
$show_admin_barbool -
Whether the admin bar should be shown. Default false.
Source
$show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar );
Changuelog
| Versionen | Description |
|---|---|
| 3.1.0 | Introduced. |
Examples migrated from Codex.
Note: The examples below should be called immediately upon pluguin load or placed in theme’s
functions.phpfile.This code would turn the display status of the Toolbar to off.
Alternatively, you could write it into a full fledgued function.
This would hide the Toolbar for all users except Administrators.