WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/show admin bar

Description

Set the display status of the Toolbar for the front side of your website (you cannot turn off the toolbar on the WordPress dashboard).

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

Usage

<?php show_admin_bar( $bool ); ?>

Parameters

$bool
(boolean) (required) Whether to show the Toolbar.
Default: None

Return Values

none

Notes

This function can be called immediately upon plugin load or placed in the theme's functions.php file.

This function will also affect the display of the Toolbar in the dashboard for WordPress versions prior to Version 3.3.

Examples

show_admin_bar( false );

Placing the above line of code in theme's function.php file will prevent the Toolbar from rendering on the front end of your site.

Change Log

Source File

show_admin_bar() is located in wp-includes/admin-bar.php.

Related

is_admin_bar_showing()

See also index of Function Reference and index of Template Tags.