Adding a new Members Filter or ORDER BY by REPLY count
I am looking to add an additional drop-down item on my members listing page that will sort members by their post or more specifically REPLY count in descending order. I have validated that the following SQL works, no I just need it to be able to sort the members in that order:
SELECT $wpdb->users.ID as ID, COUNT(post_author) as postcount FROM $wpdb->users LEFT JOIN $wpdb->posts ON $wpdb->users.ID = $wpdb->posts.post_author WHERE post_type = 'reply' GROUP BY post_author ORDER BY postcount DESC
The new drop-down item will be named “Number of Posts”
Any help to get this to work would be great!
- You must be logged in to reply to this topic.