update_user_option()函数
update_user_option()函数作用利用全局博客权限更新用户选项。
用户选项类似于用户元数据,唯一的不同之处在于用户选项支持全局博客选项。如果'global'参数为False(默认情况下),update_user_option会预先将WordPress表前缀改成选项名称。
【函数使用】
<"htmlcode"><"htmlcode"><?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.