Make WordPress Core

Opened 22 months ago

Last modified 22 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:


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 22 months ago.
class-wp-users-list-table with role

Download all attachments as: .zip

Change History (6)

@valeriosza22 months ago

class-wp-users-list-table with role

comment:1 @valeriosza22 months ago

  • Cc valeriosza@… added

comment:2 @helen22 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 @valeriosza22 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 @SergeyBiryukov22 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.