mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Prevent db error when dealing with unexistant parent term. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15734 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -696,8 +696,15 @@ class WP_Object_Query {
|
||||
foreach ( $this->tax_query as $query ) {
|
||||
if ( !isset( $query['include_children'] ) )
|
||||
$query['include_children'] = true;
|
||||
|
||||
$query['do_query'] = false;
|
||||
$sql[] = get_objects_in_term( $query['terms'], $query['taxonomy'], $query );
|
||||
|
||||
$sql_single = get_objects_in_term( $query['terms'], $query['taxonomy'], $query );
|
||||
|
||||
if ( empty( $sql_single ) )
|
||||
return ' AND 0 = 1';
|
||||
|
||||
$sql[] = $sql_single;
|
||||
}
|
||||
|
||||
if ( 1 == count( $sql ) ) {
|
||||
|
||||
Reference in New Issue
Block a user