• jehanproc

    (@jehanproc)


    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Front end or back end?

    Thread Starter jehanproc

    (@jehanproc)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    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…

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Thread Starter jehanproc

    (@jehanproc)

    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 .

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    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.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘list main site users’ is closed to new replies.