wp_admin_bar_sidebar_toggle()WP 3.8.0

Adds the sidebar toggle button.

No Hooks.

Return

null. Nothing.

Usage

wp_admin_bar_sidebar_toggle( $wp_admin_bar );
$wp_admin_bar(WP_Admin_Bar) (required)
The WP_Admin_Bar instance.

Changelog

Since 3.8.0 Introduced.

Code of wp_admin_bar_sidebar_toggle() WP 6.0

function wp_admin_bar_sidebar_toggle( $wp_admin_bar ) {
	if ( is_admin() ) {
		$wp_admin_bar->add_node(
			array(
				'id'    => 'menu-toggle',
				'title' => '<span class="ab-icon" aria-hidden="true"></span><span class="screen-reader-text">' . __( 'Menu' ) . '</span>',
				'href'  => '#',
			)
		);
	}
}