show_admin_bar

函数


show_admin_bar ( $show )
参数
  • (bool)
    $show
    Whether to allow the admin bar to show.
    Required:
定义位置
  • wp-includes/admin-bar.php
    , line 1234
引入
3.1.0
弃用

设置管理栏的显示状态。

这可以在插件加载时立即调用。它不需要从一个与{@see ‘init’}动作钩子的函数中调用。

function show_admin_bar( $show ) {
	global $show_admin_bar;
	$show_admin_bar = (bool) $show;
}