WordPress.org

Support

Support » How-To and Troubleshooting » How to get all blogs of user?

How to get all blogs of user?

  • Given is the user id..

    How can I display all the blogs where this user is administrator?

    I tried,

    <?php
    $user_id = 2;
    $user_blogs = get_blogs_of_user( $user_id );
    echo '<ul>';
    foreach ($user_blogs AS $user_blog) {
        echo '<li>'.$user_blog->blogname.'</li>';
    }
    echo '</ul>';
    ?>

    However, it will return all the blogs where user has access to regardless if it is an administrator or just a subscriber. But all i want to display is those blogs where this user is administrator.

    Is this possible? If yes, How? Please help.

  • The topic ‘How to get all blogs of user?’ is closed to new replies.
Skip to toolbar