Changeset 27837
- Timestamp:
- 03/29/2014 06:07:17 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r27827 r27837 1108 1108 1109 1109 foreach ( (array) $terms[$term_id] as $child ) { 1110 if ( $term_id == $child ) { 1111 continue; 1112 } 1113 1110 1114 if ( isset($terms[$child]) ) 1111 1115 $children = array_merge($children, get_term_children($child, $taxonomy)); -
trunk/tests/phpunit/tests/term/getTerms.php
r27459 r27837 334 334 $this->assertEquals( 1, count( $terms ) ); 335 335 } 336 337 /** 338 * @ticket 27123 339 */ 340 function test_get_term_children_recursion() { 341 // Assume there is a way to insert a term with the parent pointing to itself 342 // See: https://core.trac.wordpress.org/changeset/15806 343 remove_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10 ); 344 345 $term = wp_insert_term( 'Test', 'category' ); 346 $term = wp_update_term( $term['term_id'], 'category', array( 'parent' => $term['term_id'] ) ); 347 $term = get_term( $term['term_id'], 'category' ); 348 349 $this->assertEquals( $term->term_id, $term->parent ); 350 $this->assertInternalType( 'array', get_term_children( $term->term_id, 'category' ) ); 351 352 add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); 353 } 336 354 }
Note: See TracChangeset
for help on using the changeset viewer.