Make WordPress Core

Opened 4 years ago

Last modified 4 years ago

#49418 new enhancement

Ability to order users by number of posts in custom post type

Reported by: meevly's profile meevly Owned by:
Milestone: Awaiting Review Priority: normal
Severity: trivial Version: 5.4
Component: Users Keywords:
Focuses: Cc:


When searching for users by post_count, post type post is hardcoded in WP_User_Query class at line 765. I would like to suggest adding a parameter that allows sorting users by post count in a custom post type.

Attachments (1)

Screenshot_1.png (37.8 KB) - added by meevly 4 years ago.

Download all attachments as: .zip

Change History (2)

4 years ago

#1 @sabernhardt
4 years ago

@meevly Thanks for the ticket and welcome to Trac!

This functionality would be more appropriate in a plugin instead of core, especially if one person wants a count for a specific custom post type and another wants to sort on the total of multiple post types. (See also related ticket:15200#comment:1 about showing the counts.)

Admin Columns Pro might work for you. The free version enables you add a Post Count column for a custom post type, and sorting that column is a Pro feature.

I found out about that plugin when searching the support forum:

And there is at least one support topic about creating your own solution:

Note: See TracTickets for help on using tickets.