Advertisements

is_user_option_local

Definition:
function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {}

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

Parameters

  • string $key
  • int $user_id: Optional. Defaults to current user.
  • int $blog_id: Optional. Defaults to current blog.

Source code

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

	global $wpdb;



	$current_user = wp_get_current_user();

	if ( $user_id == 0 )

		$user_id = $current_user->ID;

	if ( $blog_id == 0 )

		$blog_id = $wpdb->blogid;



	$local_key = $wpdb->base_prefix . $blog_id . '_' . $key;



	if ( isset( $current_user->$local_key ) )

		return true;



	return false;

}

2223

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: