Changeset 15654
- Timestamp:
- 09/24/2010 02:08:07 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r15631 r15654 472 472 $operator = 'IN'; 473 473 474 if ( is_taxonomy_hierarchical( $taxonomy ) && $include_children ) { 475 $children = array(); 476 foreach ( $terms as $term ) { 477 if ( 'term_id' != $field ) { 478 if ( $term = get_term_by( $field, $term, $taxonomy ) ) 479 $term = $term->term_id; 480 else 481 continue; 482 } 483 $children = array_merge( $children, get_term_children( $term, $taxonomy ) ); 484 $children[] = $term; 485 } 486 $terms = $children; 487 $field = 'term_id'; 488 } 489 474 490 $taxonomies = "'" . implode( "', '", $taxonomies ) . "'"; 475 491 … … 477 493 case 'term_id': 478 494 $terms = array_map( 'intval', $terms ); 479 480 if ( is_taxonomy_hierarchical( $taxonomy ) && $include_children ) {481 $children = $terms;482 foreach ( $terms as $term )483 $children = array_merge( $children, get_term_children( $term, $taxonomy ) );484 $terms = $children;485 }486 495 487 496 $terms = implode( ',', $terms );
Note: See TracChangeset
for help on using the changeset viewer.