function is_user_member_of_blog( $user_id, $blog_id = 0 ) {}

Find out whether a user is a member of a given blog.


  • 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 );


		return false;



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: Logo

You are commenting using your 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: