WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/06/2010 12:06:23 PM (8 years ago)
Author:
scribu
Message:

Prevent db error when dealing with unexistant parent term. See #12891

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r15731 r15734  
    697697            if ( !isset( $query['include_children'] ) )
    698698                $query['include_children'] = true;
     699
    699700            $query['do_query'] = false;
    700             $sql[] = get_objects_in_term( $query['terms'], $query['taxonomy'], $query );
     701           
     702            $sql_single = get_objects_in_term( $query['terms'], $query['taxonomy'], $query );
     703
     704            if ( empty( $sql_single ) )
     705                return ' AND 0 = 1';
     706
     707            $sql[] = $sql_single;
    701708        }
    702709
Note: See TracChangeset for help on using the changeset viewer.