WordPress.org

Ready to get started?Download WordPress

Forums

list main site users (7 posts)

  1. jehanproc
    Member
    Posted 2 years ago #

    hello
    on a WP multisite (network) installation, there seems to be no way for a subsite to list all available users from the main network site.
    when adding users to the subsite, you can "add existing users", but cannot list them !
    probably because they are from the main site, but not yet from the subsite.
    For a subsite admin, it's impossible to guess the username/login/id of the users already regitered to the main site .

    Let me know how from a subsite, we could list main site users ?

    Thanks.

  2. Front end or back end?

  3. jehanproc
    Member
    Posted 2 years ago #

    Front end ,
    I wish admins of subsites (they don't have access to the core / BD of WP !) to be able to add existing main site users easily => select them from a list, or at least browse them, then cust&paste their Ids as new users to their subsite.

  4. Assuming the blog ID is 1:

    <ul>
    
<?php
    
    $blogusers = get_users('blog_id=1&orderby=nicename');
    
    foreach ($blogusers as $user) {
    
        echo '<li>' . $user->user_login . '</li>';
    
    }
?>

    </ul>

    I wish admins of subsites (they don't have access to the core / BD of WP !) to be able to add existing main site users easily => select them from a list, or at least browse them, then cust&paste their Ids as new users to their subsite.

    In 3.4 there's auto-fill for user names. And I think someone made a plugin for dropdowns...

  5. jehanproc
    Member
    Posted 2 years ago #

    thanks, indeed that plugin does it for the superAdmin => network admin !
    for exemple it works on page wp-admin/network/site-users.php?id=X

    but for a subsite admin, he has acces only to his subsite user administration:
    wp-admin/user-new.php
    then, on this page the plugin doesn't apply .

    I want subsite blog admins to be able to add users from existing users listed on the main site.

    I didn't tried the code you proposed
    "... $blogusers = get_users('blog_id=1&orderby=nicename'); ..."
    because I don't know where to put that code !?

    Thanks .

  6. I want subsite blog admins to be able to add users from existing users listed on the main site.

    You really can't. Site Admins don't have access to SEE users who aren't on their sites. It's for security.

Topic Closed

This topic has been closed to new replies.

About this Topic