show_admin_bar
Filters whether to show the admin bar.
Returning false to this hook is the recommended way to hide the admin bar. The user's display preference is used for logged in users.
Usage
add_filter( 'show_admin_bar', 'wp_kama_show_admin_bar_filter' ); /** * Function for `show_admin_bar` filter-hook. * * @param bool $show_admin_bar Whether the admin bar should be shown. * * @return bool */ function wp_kama_show_admin_bar_filter( $show_admin_bar ){ // filter... return $show_admin_bar; }
- $show_admin_bar(true|false)
- Whether the admin bar should be shown.
Default: false
Changelog
Since 3.1.0 | Introduced. |
Where the hook is called
show_admin_bar
wp-includes/admin-bar.php 1382
$show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar );