_get_admin_bar_pref
函数
_get_admin_bar_pref ( $context = 'front', $user = 0 )
- Access
- Private
- 参数
-
-
(string)
$context
Context of this preference check. Defaults to ‘front’. The ‘admin’ preference is no longer used.- Required: 否
- Default: ‘front’
-
(int)
$user
Optional. ID of the user to check, defaults to 0 for current user.- Required: 否
-
(string)
- 返回值
-
- (bool) Whether the admin bar should be showing for this user.
- 定义位置
-
-
wp-includes/admin-bar.php
, line 1304
-
wp-includes/admin-bar.php
- 引入
- 3.1.0
- 弃用
- –
Retrieves the admin bar display preference of a user.
function _get_admin_bar_pref( $context = 'front', $user = 0 ) { $pref = get_user_option( "show_admin_bar_{$context}", $user ); if ( false === $pref ) { return true; } return 'true' === $pref; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。