Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




is_user_member_of_blog [ WordPress Function ]

is_user_member_of_blog ( $user_id = 0, $blog_id = 0 )
Parameters:
  • (int) $user_id Optional. The unique ID of the user. Defaults to the current user.
  • (int) $blog_id Optional. ID of the blog to check. Defaults to the current site.
Uses:
Returns:
  • (bool)
Defined at:



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

Source


<?php
function is_user_member_of_blog$user_id 0$blog_id ) {
    
$user_id = (int) $user_id;
    
$blog_id = (int) $blog_id;

    if ( empty( 
$user_id ) )
        
$user_id get_current_user_id();

    if ( empty( 
$blog_id ) )
        
$blog_id get_current_blog_id();

    
$blogs get_blogs_of_user$user_id );
    return 
array_key_exists$blog_id$blogs );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics