【函数用法】
<?php get_user_option( $option, $user, $check_blog_options ) ?>
【参数介绍】
$option
(字符串)(必需)用户选项名称
默认值:None
$user
(整数)(可选)用户ID
默认值:0
$check_blog_options
(布尔值)(可选)如果之前的用户选项不存在,是否需要在选项表中查找一个选项
默认值:true
【返回值】
(混合)
成功返回选项的值,失败返回FALSE
【函数实例】
<?php $bar = get_user_option( 'show_admin_bar_front', get_current_user_id() ); if( $bar == 'true' ) { echo 'The admin bar is enabled'; } else { echo 'The admin bar is disabled'; } ?>
【源文件】
get_user_option() is located in wp-includes/user.php.
标签:WordPress
相关阅读 >>
几个优化wordpress中javascript加载体验的插件介绍
详解wordpress中用于合成数组的wp_parse_args()函数
网易蜂巢的docker容器中架设或迁移wordpress的教程
更多相关阅读请进入《wordpress》频道 >>