Make WordPress Core


Ignore:
Timestamp:
09/05/2013 05:14:54 PM (12 years ago)
Author:
wonderboymusic
Message:

Avoid database error when include or exclude is not really a term_id. Adds more unit tests.

Props kovshenin.
Fixes #11823.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r25241 r25257  
    13111311    }
    13121312
    1313     if ( ! empty( $inclusions ) )
     1313    if ( ! empty( $inclusions ) ) {
    13141314        $inclusions = ' AND t.term_id IN ( ' . $inclusions . ' )';
    1315     $where .= $inclusions;
     1315        $where .= $inclusions;
     1316    }
    13161317
    13171318    $exclusions = '';
     
    13401341
    13411342    $exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $args );
    1342     $where .= $exclusions;
     1343
     1344    if ( ! empty( $exclusions ) )
     1345        $where .= $exclusions;
    13431346
    13441347    if ( !empty($slug) ) {
Note: See TracChangeset for help on using the changeset viewer.