[wp-meta] [Making WordPress.org] #4219: WP_Term_Query where sql_clauses oddity
Making WordPress.org
noreply at wordpress.org
Tue Feb 26 02:16:56 UTC 2019
#4219: WP_Term_Query where sql_clauses oddity
---------------------+--------------------
Reporter: vrandom | Owner: (none)
Type: defect | Status: new
Priority: normal | Milestone:
Component: General | Keywords:
---------------------+--------------------
Hello, I was messing around with a customized version of the WP_Term_Query
and noticed something odd.
In the function get_terms, there are a lot of places where
{{{$this->sql_clauses['where'][somekey]}}} variables are created.
However, on line [https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/class-wp-term-query.php#L642 643], this code :
{{{#!php
$where = implode( ' AND ', $this->sql_clauses['where'] );
}}}
only uses the first subvalue found and ignores all the keys.
Shouldn't this be:
{{{#!php
$where = implode( ' AND ', array_values($this->sql_clauses['where']));
}}}
so that all array elements are included in the where?
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/4219>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list