Ticket #23506: 23506.diff
File 23506.diff, 2.1 KB (added by , 11 years ago) |
---|
-
wp-includes/taxonomy.php
1232 1232 extract($args, EXTR_SKIP); 1233 1233 1234 1234 if ( $child_of ) { 1235 $hierarchy = _get_term_hierarchy( $taxonomies[0]);1235 $hierarchy = _get_term_hierarchy(reset($taxonomies)); 1236 1236 if ( !isset($hierarchy[$child_of]) ) 1237 1237 return $empty_array; 1238 1238 } 1239 1239 1240 1240 if ( $parent ) { 1241 $hierarchy = _get_term_hierarchy( $taxonomies[0]);1241 $hierarchy = _get_term_hierarchy(reset($taxonomies)); 1242 1242 if ( !isset($hierarchy[$parent]) ) 1243 1243 return $empty_array; 1244 1244 } … … 1307 1307 if ( !empty( $exclude_tree ) ) { 1308 1308 $excluded_trunks = wp_parse_id_list($exclude_tree); 1309 1309 foreach ( $excluded_trunks as $extrunk ) { 1310 $excluded_children = (array) get_terms( $taxonomies[0], array('child_of' => intval($extrunk), 'fields' => 'ids', 'hide_empty' => 0));1310 $excluded_children = (array) get_terms(reset($taxonomies), array('child_of' => intval($extrunk), 'fields' => 'ids', 'hide_empty' => 0)); 1311 1311 $excluded_children[] = $extrunk; 1312 1312 foreach( $excluded_children as $exterm ) { 1313 1313 if ( empty($exclusions) ) … … 1416 1416 } 1417 1417 1418 1418 if ( $child_of ) { 1419 $children = _get_term_hierarchy( $taxonomies[0]);1419 $children = _get_term_hierarchy(reset($taxonomies)); 1420 1420 if ( ! empty($children) ) 1421 $terms = _get_term_children($child_of, $terms, $taxonomies[0]);1421 $terms = _get_term_children($child_of, $terms, reset($taxonomies)); 1422 1422 } 1423 1423 1424 1424 // Update term counts to include children. 1425 1425 if ( $pad_counts && 'all' == $fields ) 1426 _pad_term_counts($terms, $taxonomies[0]);1426 _pad_term_counts($terms, reset($taxonomies)); 1427 1427 1428 1428 // Make sure we show empty categories that have children. 1429 1429 if ( $hierarchical && $hide_empty && is_array($terms) ) { 1430 1430 foreach ( $terms as $k => $term ) { 1431 1431 if ( ! $term->count ) { 1432 $children = _get_term_children($term->term_id, $terms, $taxonomies[0]);1432 $children = _get_term_children($term->term_id, $terms, reset($taxonomies)); 1433 1433 if ( is_array($children) ) 1434 1434 foreach ( $children as $child ) 1435 1435 if ( $child->count )