Changeset 25108
- Timestamp:
- 08/23/2013 09:28:34 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r25106 r25108 1236 1236 1237 1237 if ( $child_of ) { 1238 $hierarchy = _get_term_hierarchy( $taxonomies[0]);1239 if ( ! isset($hierarchy[$child_of]) )1238 $hierarchy = _get_term_hierarchy( reset( $taxonomies ) ); 1239 if ( ! isset( $hierarchy[ $child_of ] ) ) 1240 1240 return $empty_array; 1241 1241 } 1242 1242 1243 1243 if ( $parent ) { 1244 $hierarchy = _get_term_hierarchy( $taxonomies[0]);1245 if ( ! isset($hierarchy[$parent]) )1244 $hierarchy = _get_term_hierarchy( reset( $taxonomies ) ); 1245 if ( ! isset( $hierarchy[ $parent ] ) ) 1246 1246 return $empty_array; 1247 1247 } … … 1308 1308 1309 1309 $exclusions = ''; 1310 if ( ! empty( $exclude_tree ) ) {1311 $excluded_trunks = wp_parse_id_list( $exclude_tree);1310 if ( ! empty( $exclude_tree ) ) { 1311 $excluded_trunks = wp_parse_id_list( $exclude_tree ); 1312 1312 foreach ( $excluded_trunks as $extrunk ) { 1313 $excluded_children = (array) get_terms( $taxonomies[0], array('child_of' => intval($extrunk), 'fields' => 'ids', 'hide_empty' => 0));1313 $excluded_children = (array) get_terms( reset( $taxonomies ), array( 'child_of' => intval( $extrunk ), 'fields' => 'ids', 'hide_empty' => 0 ) ); 1314 1314 $excluded_children[] = $extrunk; 1315 1315 foreach( $excluded_children as $exterm ) { 1316 if ( empty( $exclusions) )1316 if ( empty( $exclusions ) ) 1317 1317 $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' '; 1318 1318 else … … 1420 1420 1421 1421 if ( $child_of ) { 1422 $children = _get_term_hierarchy( $taxonomies[0]);1423 if ( ! empty( $children) )1424 $terms = _get_term_children( $child_of, $terms, $taxonomies[0]);1422 $children = _get_term_hierarchy( reset( $taxonomies ) ); 1423 if ( ! empty( $children ) ) 1424 $terms = _get_term_children( $child_of, $terms, reset( $taxonomies ) ); 1425 1425 } 1426 1426 1427 1427 // Update term counts to include children. 1428 1428 if ( $pad_counts && 'all' == $fields ) 1429 _pad_term_counts( $terms, $taxonomies[0]);1429 _pad_term_counts( $terms, reset( $taxonomies ) ); 1430 1430 1431 1431 // Make sure we show empty categories that have children. 1432 if ( $hierarchical && $hide_empty && is_array( $terms) ) {1432 if ( $hierarchical && $hide_empty && is_array( $terms ) ) { 1433 1433 foreach ( $terms as $k => $term ) { 1434 1434 if ( ! $term->count ) { 1435 $children = _get_term_children( $term->term_id, $terms, $taxonomies[0]);1436 if ( is_array( $children) )1435 $children = _get_term_children( $term->term_id, $terms, reset( $taxonomies ) ); 1436 if ( is_array( $children ) ) 1437 1437 foreach ( $children as $child ) 1438 1438 if ( $child->count )
Note: See TracChangeset
for help on using the changeset viewer.