Make WordPress Core

Opened 12 years ago

Last modified 6 years ago

#21744 reopened enhancement

WP_User_Query does not support post type

Reported by: alimh's profile AliMH Owned by:
Milestone: Awaiting Review 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 12 years ago.
21744.patch (761 bytes) - added by johnbillion 12 years ago.

Download all attachments as: .zip

Change History (13)

@AliMH
12 years ago

#1 follow-up: @wonderboymusic
12 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? Even so, your 'post-type' query arg doesn't change the SQL.

What's your use case? Are you trying to order authors by their post count for a particular post_type?

Version 0, edited 12 years ago by wonderboymusic (next)

#2 @SergeyBiryukov
12 years ago

  • Keywords reporter-feedback added; has-patch removed

#3 @scribu
12 years ago

  • Cc scribu added

@johnbillion
12 years ago

#5 @johnbillion
12 years ago

AliMH's change in patch format

#6 in reply to: ↑ 1 @AliMH
12 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.

#7 @SergeyBiryukov
12 years ago

  • Keywords reporter-feedback removed

Related: #23045

#8 follow-up: @chriscct7
9 years 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

#9 @DrewAPicture
9 years ago

  • Milestone Awaiting Review deleted

#10 in reply to: ↑ 8 @Ali-MH
6 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Replying to chriscct7:

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

after a long time i again face same problem and come to check if it become in core or not!
i knew that's possible with custom query and i'm doing this with custom query but when it's possible done this in core by just changing two lines in core and query support custom post type ,just ignore it!?

#11 @SergeyBiryukov
6 years ago

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