WordPress.org

Make WordPress Core

Opened 13 months ago

Last modified 4 months ago

#38308 new feature request

Accept 'meta_query' parameter in `WP_Tax_Query`

Reported by: Hrohh Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.4
Component: Taxonomy Keywords: needs-patch
Focuses: Cc:

Description

It would by possible to extend like that?

<?php
$args = array(
        'post_type' => 'post',
        'tax_query' => array(
                array(
                        'taxonomy'      => 'people',
                        'field'         => 'meta',
                        'meta_query'    => array(
                                array(
                                        'key' => 'map',
                                        'compare' => 'EXIST'
                                )
                        )
                ),
        ),
);
$query = new WP_Query( $args );
?>

Change History (3)

#1 @boonebgorges
13 months ago

  • Component changed from Query to Taxonomy
  • Focuses administration removed
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from wp query and term metadata to Accept 'meta_query' parameter in `WP_Tax_Query`
  • Version changed from trunk to 4.4

Hi @Hrohh - This is a very interesting idea. It's more of an enhancement request for WP_Tax_Query than for WP_Query, so I'm going to recategorize the ticket as appropriate.

Last edited 13 months ago by boonebgorges (previous) (diff)

#2 @boonebgorges
4 months ago

#41265 was marked as a duplicate.

#3 @boonebgorges
4 months ago

I like this idea, but we'll need to see at least a proof-of-concept patch to move forward with it. There are a number of questions I've got about how queries will be constructed and cacheability - whether we should use IN ( results of a WP_Term_Query ) or a separate JOIN - that will only be clearer once we've got some patches to benchmark.

Note: See TracTickets for help on using tickets.