WordPress.org

Ready to get started?Download WordPress

Forums

How to get all blogs of user? (1 post)

  1. chibib0
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags