show_admin_bar

Sets the display status of the admin bar.

Description

show_admin_bar( (bool) $show ); 

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

Parameters (1)

0. $show (bool)
Whether to allow the admin bar to show.

Usage

  1. if ( !function_exists( 'show_admin_bar' ) ) { 
  2. require_once ABSPATH . WPINC . '/admin-bar.php'; 
  3.  
  4. // Whether to allow the admin bar to show. 
  5. $show = true; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = show_admin_bar($show); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/admin-bar.php  
  1. function show_admin_bar( $show ) { 
  2. global $show_admin_bar; 
  3. $show_admin_bar = (bool) $show;