Changeset 30265
- Timestamp:
- 11/06/2014 09:46:18 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r30241 r30265 1650 1650 // Save queries by not crawling the tree in the case of multiple taxes or a flat tax. 1651 1651 if ( ! $single_taxonomy || ! is_taxonomy_hierarchical( reset( $taxonomies ) ) ) { 1652 $args['child_of'] = false;1653 1652 $args['hierarchical'] = false; 1654 1653 $args['pad_counts'] = false; -
trunk/tests/phpunit/tests/term/getTerms.php
r30113 r30265 172 172 get_terms( 'post_tag', array( 'include' => array( 'unexpected-string' ), 'hide_empty' => false ) ); 173 173 $this->assertEmpty( $wpdb->last_error ); 174 } 175 176 /** 177 * @ticket 30275 178 */ 179 public function test_exclude_with_hierarchical_true_for_non_hierarchical_taxonomy() { 180 register_taxonomy( 'wptests_tax', 'post' ); 181 182 $terms = $this->factory->term->create_many( 2, array( 183 'taxonomy' => 'wptests_tax', 184 ) ); 185 186 $found = get_terms( 'wptests_tax', array( 187 'taxonomy' => 'wptests_tax', 188 'hide_empty' => false, 189 'exclude_tree' => array( $terms[0] ), 190 'hierarchical' => true, 191 ) ); 192 193 $this->assertEquals( array( $terms[1] ), wp_list_pluck( $found, 'term_id' ) ); 194 195 _unregister_taxonomy( 'wptests_tax' ); 174 196 } 175 197
Note: See TracChangeset
for help on using the changeset viewer.