[wp-trac] [WordPress Trac] #31692: WP_Query post__in parameter to accept another WP_Query objcet

WordPress Trac noreply at wordpress.org
Thu Mar 19 12:47:23 UTC 2015


#31692: WP_Query post__in parameter to accept another WP_Query objcet
-------------------------+-----------------------------
 Reporter:  maksbd19     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Query        |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 In case of constructing a query using {{{WP_Query}}} class it limits the
 relation and matches on the posts themselves. But if the query requires to
 be matched from a outer domain of posts like posts those are linked with
 another set of posts another separate query is required.

 For a clear representation of the case lets assume there are some posts
 with ID 1, 2, 3 and 4 which are linked with [11,12,13], [11,18,29],
 [12,18,19], [11,12,28,22,29] respectively (of course you can assume far
 more complex cases in which these posts can be retrieved by comparing some
 other meta values). Now using the current WP_Query class we can fetch
 posts that match with the desired query and by using {{{post__in}}}
 parameter we can limit the result. For this a separate query for the
 linked posts is required.

 I request to the community and the experts for a separate class for this
 parameter may be like {{{WP_Meta_Query}}} so that the query class could be
 used in even more complicated and advanced cases.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31692>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list