• Resolved akvbroek

    (@akvbroek)


    Maybe my brain is being stupid this morning, but I cannot for the life of me find an answer to this seemingly simple problem.

    How do I get a list of all users in the multi-site network?

    get_users() and WP_User_Query() must specify a site or defaults to current site. Am I missing something simple?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You could just directly query the users table with $wpdb.

    Thread Starter akvbroek

    (@akvbroek)

    Duh. Thank you.

    //Get All WordPress Users
    global $wpdb;
    $allusers = $wpdb->get_results("SELECT ID, user_nicename FROM $wpdb->users");
    foreach ( $allusers as $u ) {
    	echo '<p>$u->ID.' - '.$u->user_nicename.'</p>';
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get a List of all Users in Network’ is closed to new replies.