Changeset 37623
- Timestamp:
- 06/02/2016 02:37:55 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r37622 r37623 1209 1209 $terms = $term_query->query( $args ); 1210 1210 1211 // Count queries are not filtered, for legacy reasons. 1212 if ( $term_query->query_vars['count'] ) { 1213 return $terms; 1214 } 1215 1211 1216 /** 1212 1217 * Filters the found terms. -
trunk/tests/phpunit/tests/term/getTerms.php
r37599 r37623 2180 2180 } 2181 2181 2182 /** 2183 * @ticket 36992 2184 * @ticket 35381 2185 */ 2186 public function test_count_should_pass_through_main_get_terms_filter() { 2187 add_filter( 'get_terms', array( __CLASS__, 'maybe_filter_count' ) ); 2188 2189 $found = get_terms( array( 2190 'hide_empty' => 0, 2191 'count' => true, 2192 ) ); 2193 2194 remove_filter( 'get_terms', array( __CLASS__, 'maybe_filter_count' ) ); 2195 2196 $this->assertNotEquals( 'foo', $found ); 2197 } 2198 2199 public static function maybe_filter_count() { 2200 return 'foo'; 2201 } 2202 2182 2203 protected function create_hierarchical_terms_and_posts() { 2183 2204 $terms = array();
Note: See TracChangeset
for help on using the changeset viewer.