[wp-trac] [WordPress Trac] #36724: who=>authors breaks meta arguments in user queries
WordPress Trac
noreply at wordpress.org
Mon May 2 18:54:18 UTC 2016
#36724: who=>authors breaks meta arguments in user queries
-------------------------------------------------+-------------------------
Reporter: Rarst | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
Component: Users | Review
Severity: normal | Version: trunk
Keywords: needs-unit-tests good-first-bug | Resolution:
needs-patch | Focuses:
-------------------------------------------------+-------------------------
Changes (by boonebgorges):
* keywords: needs-unit-tests good-first-bug dev-feedback has-patch =>
needs-unit-tests good-first-bug needs-patch
Comment:
Thanks for the patch, @adrianosilvaferreira! Unfortunately, this approach
won't work for a couple reasons. It will create a `meta_query` parameter
that is not well-formed: meta queries must be multi-dimensional arrays,
and each key/value pair must be part of its own array:
{{{
'meta_query' => array(
array(
'key' => 'foo',
'value' => 'bar',
)
)
}}}
You're missing a level of nesting. Also, if you simply append a clause to
the existing `meta_query`, you may cause problems if the top-level
'relation' is 'OR'.
To make this work right, a new clause will need to be created for the
'who' parameter, and that clause will need to be joined to the existing
`meta_query` using `relation=AND`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36724#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list