A WordPress-centric search engine for devs and theme authors



is_user_option_local ›

Since3.0.0
Deprecated4.9.0
is_user_option_local ( $key, $user_id = 0, $blog_id = 0 )
Parameters: (3)
  • (string) $key
    Required: Yes
  • (int) $user_id Optional. Defaults to current user.
    Required: No
    Default:
  • (int) $blog_id Optional. Defaults to current blog.
    Required: No
    Default:
Returns:
  • (bool)
Defined at:
Codex:
Change Log:
  • MU

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



Source

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

	_deprecated_function( __FUNCTION__, '4.9.0' );

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

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