WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

WPMU Functions/is user member of blog

Description

Checks to see if the specified user is a member of the specified blog.

Usage

<?php is_user_member_of_blog$user_id$blog_id ); ?>

Parameters

$user_id
(integer) (optional) The id of the user you want to check membership for.
Default: current user
$blog_id
(integer) (optional) The id of the blog you want to check membership for.
Default: current site

Return Values

(boolean) 
True, if user is a member of the specified blog, else false.

Examples

<?php
    global $current_user;
    get_currentuserinfo();

    if ( is_user_member_of_blog( $current_user->ID ) ) {
       echo 'You are a member of this blog.';
    } else {
       echo 'You are NOT a member of this blog.';
    }
?>