show_admin_bar( bool $show )

Sets the display status of the admin bar.

Description Description

This can be called immediately upon plugin load. It does not need to be called from a function hooked to the ‘init’ action.

Top ↑

Parameters Parameters


(bool) (Required) Whether to allow the admin bar to show.

Top ↑

More Information More Information

This function should 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.

Top ↑

Source Source

File: wp-includes/admin-bar.php

function show_admin_bar( $show ) {
	global $show_admin_bar;
	$show_admin_bar = (bool) $show;

Top ↑

Changelog Changelog

Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.