Forums

[resolved] A way to display all users in one view? (6 posts)

  1. wp.rook
    Member
    Posted 2 years ago #

    I'd like to be able to see all of the users of my blog in one table (which could be sortable).

    Is there a plugin, or otherwise easy way to do this?

    I'm thinking I need to access the user table somehow in the SQL code...

    Thanks

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    Could put this in a Page Template, a PHP Code Widget, or sidebar.php, or even an archive template:

    <?php
    //displays users
    $blogusers = get_users_of_blog();
    if ($blogusers) {
      foreach ($blogusers as $bloguser) {
        $user = get_userdata($bloguser->user_id);
        echo '<p>User ID ' . $user->ID . ' ' . $user->user_firstname . ' ' . $user->user_lastname . '</p>';
      }
    }
    ?>
  3. wp.rook
    Member
    Posted 2 years ago #

    Ok, that makes sense.

    Now, I'm using a plugin called Cimy User Extra Fields (http://wordpress.org/extend/plugins/cimy-user-extra-fields/) will those extra fields be displayed as well?

    Thanks for your help!

  4. MichaelH
    Volunteer
    Posted 2 years ago #

    Yep--if the user field is called "what_the_heck", then echo $user->what_the_heck; would output that value.

    Put this echo "<pre>"; print_r($user); echo "</pre>"; after $user = get_userdata($bloguser->user_id); to see all the values.

  5. kevinator
    Member
    Posted 2 years ago #

    Is there a way in wp-admin for us non-coders to see all of the users in one view? It's easy to see all my pages in one view...thought it would be similar for users. I need to bulk update the roles of most of my users.

  6. MichaelH
    Volunteer
    Posted 2 years ago #

    kevinator - please start another topic with that question.

Topic Closed

This topic has been closed to new replies.

About this Topic