is_user_option_local()

最后更新于:2021-11-27 12:18:25

is_user_option_local( string$key, int$user_id, int$blog_id)

Check whether a usermeta key has to do with the current blog.

参数

$key

(string) (Required)

$user_id

(int) (Optional) Defaults to current user.

$blog_id

(int) (Optional) Defaults to current blog.

响应

(bool)

源文件

文件: gc-includes/ms-deprecated.php

function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
	global $gcdb;

	_deprecated_function( __FUNCTION__, '4.9.0' );

	$current_user = gc_get_current_user();
	if ( $blog_id == 0 ) {
		$blog_id = get_current_blog_id();
	}
	$local_key = $gcdb->get_blog_prefix( $blog_id ) . $key;

	return isset( $current_user->$local_key );
}