Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#46347 new defect (bug)

WP_Term_Query where sql_clauses oddity

Reported by: vrandom's profile vrandom Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:

Description

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 643, this code :

$where = implode( ' AND ', $this->sql_clauses['where'] );

only uses the first sub array value found and ignores all the other keys.

Shouldn't this be:

$where = implode( ' AND ', array_values($this->sql_clauses['where']));

so that all array elements are included in the where?

Change History (1)

#1 @desrosj
6 years ago

  • Component changed from General to Query
Note: See TracTickets for help on using tickets.