WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/02/16 14:37:55 (15 months ago)
Author:
boonebgorges
Message:

Taxonomy: Don't pass results of 'count' query through 'get_terms' filter.

Use of the 'get_terms' filter was consolidated in [37572], with the
introduction of WP_Term_Query. At that time, the result of 'count=true'
queries began being filtered by 'get_terms'. This breaks existing 'get_terms'
callbacks, which often assume that the returned value will be an array or a
WP_Error object.

Props JustinSainton.
Fixes #36992.

File:
1 edited

Legend:

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

    r37622 r37623  
    12091209    $terms = $term_query->query( $args ); 
    12101210 
     1211    // Count queries are not filtered, for legacy reasons. 
     1212    if ( $term_query->query_vars['count'] ) { 
     1213        return $terms; 
     1214    } 
     1215 
    12111216    /** 
    12121217     * Filters the found terms. 
Note: See TracChangeset for help on using the changeset viewer.