On this page
wp_admin_bar_sidebar_toggle( WP_Admin_Bar $wp_admin_bar )
Adds the sidebar toggle button.
Parameters
$wp_admin_barWP_Admin_Bar Required-
The WP_Admin_Bar instance.
Source
File: wp-includes/admin-bar.php. View all references
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' => '#',
)
);
}
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Admin_Bar::add_node() wp-includes/class-wp-admin-bar.php | Adds a node to the menu. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
| is_admin() wp-includes/load.php | Determines whether the current request is for an administrative interface page. |
Changelog
| Version | Description |
|---|---|
| 3.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_admin_bar_sidebar_toggle