WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 6 months ago

#25765 new enhancement

Directory of users, listing with the role

Reported by: valeriosza Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Users Keywords: close
Focuses: Cc:

Description

It took me a list of users, with a large site with many levels to know what are administrators, a simple list and still continue seeing the other functions.

Attachments (1)

patch#25765.patch (374 bytes) - added by valeriosza 6 months ago.
class-wp-users-list-table with role

Download all attachments as: .zip

Change History (6)

valeriosza6 months ago

class-wp-users-list-table with role

comment:1 valeriosza6 months ago

  • Cc valeriosza@… added

comment:2 helen6 months ago

  • Keywords close added
  • Version trunk deleted

I take it you want to sort by role name, which is not exactly feasible on the query level. Did you test your patch? I would be quite shocked if it worked as-is.

Also note that users can actually have more than one role.

comment:3 valeriosza6 months ago

I sent the patch because I talked to several people, at least for us with large-scale sites was great need for sites with more than 400 users. The filter option does not allow show managers and employees at the same time, for example.

comment:4 SergeyBiryukov6 months ago

The patch doesn't work as expected.

It makes the Role column sortable, and orderby=role is then added to the URL, but WP_User_Query cannot order by role, so it falls back to sorting by user_login: tags/3.7.1/src/wp-includes/user.php#L421.

This can probably be implemented in a plugin though. manage_users_sortable_columns and pre_user_query filters might be helpful.

Note: See TracTickets for help on using tickets.