wp_admin_bar_sidebar_toggle()WP 3.8.0

Adds the sidebar toggle button.

No Hooks.

Return

null. Nothing (null).

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.

wp_admin_bar_sidebar_toggle() code WP 6.5.2

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">' .
						/* translators: Hidden accessibility text. */
						__( 'Menu' ) .
					'</span>',
				'href'  => '#',
			)
		);
	}
}