Changeset 31276 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 01/25/2015 02:45:11 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r31275 r31276 1658 1658 $args = apply_filters( 'get_terms_args', $args, $taxonomies ); 1659 1659 1660 // Avoid the query if the queried parent/child_of term has no descendants. 1660 1661 $child_of = $args['child_of']; 1662 $parent = $args['parent']; 1663 1661 1664 if ( $child_of ) { 1662 $hierarchy = _get_term_hierarchy( reset( $taxonomies ) ); 1663 if ( ! isset( $hierarchy[ $child_of ] ) ) { 1664 return $empty_array; 1665 } 1666 } 1667 1668 $parent = $args['parent']; 1669 if ( $parent ) { 1670 $hierarchy = _get_term_hierarchy( reset( $taxonomies ) ); 1671 if ( ! isset( $hierarchy[ $parent ] ) ) { 1665 $_parent = $child_of; 1666 } elseif ( $parent ) { 1667 $_parent = $parent; 1668 } else { 1669 $_parent = false; 1670 } 1671 1672 if ( $_parent ) { 1673 $in_hierarchy = false; 1674 foreach ( $taxonomies as $_tax ) { 1675 $hierarchy = _get_term_hierarchy( $_tax ); 1676 1677 if ( isset( $hierarchy[ $_parent ] ) ) { 1678 $in_hierarchy = true; 1679 } 1680 } 1681 1682 if ( ! $in_hierarchy ) { 1672 1683 return $empty_array; 1673 1684 } … … 1943 1954 1944 1955 if ( $child_of ) { 1945 $children = _get_term_hierarchy( reset( $taxonomies ) ); 1946 if ( ! empty( $children ) ) { 1947 $terms = _get_term_children( $child_of, $terms, reset( $taxonomies ) ); 1956 foreach ( $taxonomies as $_tax ) { 1957 $children = _get_term_hierarchy( $_tax ); 1958 if ( ! empty( $children ) ) { 1959 $terms = _get_term_children( $child_of, $terms, $_tax ); 1960 } 1948 1961 } 1949 1962 }
Note: See TracChangeset
for help on using the changeset viewer.