Codex

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

WPMU Functions/is blog user

This page redirects to an external site: https://developer.wordpress.org/reference/functions/is_blog_user/


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.

Use is_user_member_of_blog() instead.

Description

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

Parameters

$blog_id
(integer) (optional) The id of the blog.
Default: Current blog id.

Return Values

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

Usage

<code style="color: #000000"><span style="color: #0000BB"><?php is_blog_user</span><span style="color: #007700">(</span><span style="color: #0000BB">$blog_id</span><span style="color: #007700">) </span><span style="color: #0000BB">?></span></code>

Examples

<code style="color: #000000"><span style="color: #0000BB"><?php
   </span><span style="color: #007700">If (</span><span style="color: #0000BB">is_blog_user</span><span style="color: #007700">()) {
      </span><span style="color: #FF8000">//user is a member of this blog
   </span><span style="color: #007700">}
</span><span style="color: #0000BB">?></span></code>