wp_admin_bar_sidebar_toggle

Add the sidebar toggle button.

Description

wp_admin_bar_sidebar_toggle( (WP_Admin_Bar) $wp_admin_bar ); 

Parameters (1)

0. $wp_admin_bar (WP_Admin_Bar)
The wp admin bar.

Usage

  1. if ( !function_exists( 'wp_admin_bar_sidebar_toggle' ) ) { 
  2. require_once ABSPATH . WPINC . '/admin-bar.php'; 
  3.  
  4. // The wp admin bar. 
  5. $wp_admin_bar = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_admin_bar_sidebar_toggle($wp_admin_bar); 
  9.  

Defined (1)

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

/wp-includes/admin-bar.php  
  1. function wp_admin_bar_sidebar_toggle( $wp_admin_bar ) { 
  2. if ( is_admin() ) { 
  3. $wp_admin_bar->add_menu( array( 
  4. 'id' => 'menu-toggle',  
  5. 'title' => '<span class="ab-icon"></span><span class="screen-reader-text">' . __( 'Menu' ) . '</span>',  
  6. 'href' => '#',  
  7. ) );