设置管理栏的显示状态。
原型
show_admin_bar( bool $show )
描述
这可以在插件加载时立即调用。它不需要从连接到’init’动作的函数调用。
参数
$show
(bool)
(Required)
是否允许管理栏显示。
源文件
路径:wp-includes/admin-bar.php
<?php
...
function show_admin_bar( $show ) {
global $show_admin_bar;
$show_admin_bar = (bool) $show;
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/show_admin_bar/