- Timestamp:
- 10/26/2013 03:03:10 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r25596 r25933 1363 1363 if ( ! empty( $exclude_tree ) ) { 1364 1364 $exclude_tree = wp_parse_id_list( $exclude_tree ); 1365 $excluded_children = array();1365 $excluded_children = $exclude_tree; 1366 1366 foreach ( $exclude_tree as $extrunk ) { 1367 1367 $excluded_children = array_merge( -
trunk/tests/phpunit/tests/term/getTerms.php
r25384 r25933 153 153 154 154 /** 155 * @ticket 25710 156 */ 157 function test_get_terms_exclude_tree() { 158 159 $term_id_uncategorized = get_option( 'default_category' ); 160 161 $term_id1 = $this->factory->category->create(); 162 $term_id11 = $this->factory->category->create( array( 'parent' => $term_id1 ) ); 163 $term_id2 = $this->factory->category->create(); 164 $term_id22 = $this->factory->category->create( array( 'parent' => $term_id2 ) ); 165 166 // There's something else broken in the cache cleaning routines that leads to this having to be done manually 167 delete_option( 'category_children' ); 168 169 $terms = get_terms( 'category', array( 170 'exclude' => $term_id_uncategorized, 171 'fields' => 'ids', 172 'hide_empty' => false, 173 ) ); 174 $this->assertEquals( array( $term_id1, $term_id11, $term_id2, $term_id22 ), $terms ); 175 176 $terms = get_terms( 'category', array( 177 'fields' => 'ids', 178 'exclude_tree' => "$term_id1,$term_id_uncategorized", 179 'hide_empty' => false, 180 ) ); 181 182 $this->assertEquals( array( $term_id2, $term_id22 ), $terms ); 183 184 } 185 186 /** 155 187 * @ticket 13992 156 188 */
Note: See TracChangeset
for help on using the changeset viewer.