WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 months ago

Last modified 3 months ago

#21744 closed enhancement (wontfix)

WP_User_Query does not support post type

Reported by: AliMH Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.1
Component: Users Keywords: has-patch
Focuses: Cc:

Description

unfortunately WP_User_Query only support 'post' right now.
i've attached my modified user.php

Attachments (2)

user.php (45.2 KB) - added by AliMH 3 years ago.
21744.patch (761 bytes) - added by johnbillion 3 years ago.

Download all attachments as: .zip

Change History (11)

@AliMH3 years ago

comment:1 follow-up: @wonderboymusic3 years ago

WP_User_Query is meant to query and/or join wp_users and wp_usermeta, neither of which have anything to do with posts, unless you are talking about ordering by post_count? What's your use case? Are you trying to order authors by their post count for a particular post_type?

Last edited 3 years ago by wonderboymusic (previous) (diff)

comment:2 @SergeyBiryukov3 years ago

  • Keywords reporter-feedback added; has-patch removed

comment:3 @scribu3 years ago

  • Cc scribu added

@johnbillion3 years ago

comment:5 @johnbillion3 years ago

AliMH's change in patch format

comment:6 in reply to: ↑ 1 @AliMH3 years ago

  • Keywords has-patch added

Replying to wonderboymusic:

WP_User_Query is meant to query and/or join wp_users and wp_usermeta, neither of which have anything to do with posts, unless you are talking about ordering by post_count? What's your use case? Are you trying to order authors by their post count for a particular post_type?

sorry'i'm new in add patch to wordpress trac, thanks john for your help.
yea in post_count it's only support 'post' but most of time we need get post_count per post types.
this patch is not a big deal but need by alot of serious developer.

comment:7 @SergeyBiryukov3 years ago

  • Keywords reporter-feedback removed

Related: #23045

comment:8 @chriscct73 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

This is something that can easily be done using custom query code, and isn't something core would benefit from by adding. Closing as wontifix

comment:9 @DrewAPicture3 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.