Adds the sidebar toggle button.
$wp_admin_barWP_Admin_Barrequired
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' => '#',
)
);
}
}
| Version | Description |
|---|---|
| 3.8.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_admin_bar_sidebar_toggle