is_user_option_local()
is_user_option_local( string $key, int $user_id, int $b…
is_user_option_local( string $key, int $user_id, int $blog_id )
检查usermeta键是否与当前博客有关。
Check whether a usermeta key has to do with the current blog.
目录锚点:#返回#源码
返回(Return)
(bool)
源码(Source)
/**
* Check whether a usermeta key has to do with the current blog.
*
* @since MU
*
* @global wpdb $wpdb
*
* @param string $key
* @param int $user_id Optional. Defaults to current user.
* @param int $blog_id Optional. Defaults to current blog.
* @return bool
*/
function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
global $wpdb;
$current_user = wp_get_current_user();
if ( $blog_id == 0 ) {
$blog_id = $wpdb->blogid;
}
$local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
return isset( $current_user->$local_key );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 4.9.0 | wp-includes/ms-deprecated.php:541 | 0 | 4 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!