Definition:
function is_user_member_of_blog( $user_id, $blog_id = 0 ) {}
Find out whether a user is a member of a given blog.
Parameters
- int $user_id: The unique ID of the user
- int $blog: Optional. If no blog_id is provided, current site is used
- $blog_id
Source code
function is_user_member_of_blog( $user_id, $blog_id = 0 ) {
$user_id = (int) $user_id;
$blog_id = (int) $blog_id;
if ( $blog_id == 0 ) {
global $wpdb;
$blog_id = $wpdb->blogid;
}
$blogs = get_blogs_of_user( $user_id );
if ( is_array( $blogs ) )
return array_key_exists( $blog_id, $blogs );
else
return false;
}
2221

February 12, 2011 


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