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

February 12, 2011 


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