Viewing 2 replies - 1 through 2 (of 2 total)
  • For the record, my method for doing this is to use get_objects_in_term.

    Code sample:

    $ids_of_complete_users = get_objects_in_term(
      42, // id of group
      'user-group'
    );
    
    // then
    if (!empty($ids_of_complete_users)) {
      $user_query = new WP_User_Query( array(
        'include' => $ids_of_complete_users,
        'orderby' => 'registered',
        'order' => 'DESC'
      ) );
      if ( !empty( $user_query->results ) ) {
        foreach ( $user_query->results as $user ) {
        // display what is needed
        }
      }
    }
    Plugin Author John James Jacoby

    (@johnjamesjacoby)

    Starting in 0.2.1 you can use the wp_get_users_of_group() function!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Listing users by group’ is closed to new replies.