diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index 955369e..9dac3cc 100644
a
|
b
|
function get_terms($taxonomies, $args = '') { |
1235 | 1235 | extract($args, EXTR_SKIP); |
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 | } |
1248 | 1248 | |
… |
… |
function get_terms($taxonomies, $args = '') { |
1310 | 1310 | if ( !empty( $exclude_tree ) ) { |
1311 | 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 | 1316 | if ( empty($exclusions) ) |
… |
… |
function get_terms($taxonomies, $args = '') { |
1419 | 1419 | } |
1420 | 1420 | |
1421 | 1421 | if ( $child_of ) { |
1422 | | $children = _get_term_hierarchy($taxonomies[0]); |
| 1422 | $children = _get_term_hierarchy( reset( $taxonomies ) ); |
1423 | 1423 | if ( ! empty($children) ) |
1424 | | $terms = _get_term_children($child_of, $terms, $taxonomies[0]); |
| 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 | 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]); |
| 1435 | $children = _get_term_children( $term->term_id, $terms, reset( $taxonomies ) ); |
1436 | 1436 | if ( is_array($children) ) |
1437 | 1437 | foreach ( $children as $child ) |
1438 | 1438 | if ( $child->count ) |