Changeset 35537 for trunk/src/wp-includes/taxonomy-functions.php
- Timestamp:
- 11/05/2015 04:44:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy-functions.php
r35515 r35537 765 765 } 766 766 } else { 767 $_term = WP_Term::get_instance( $term ); 768 } 769 770 // If `$taxonomy` was provided, make sure it matches the taxonomy of the located term. 771 if ( $_term && $taxonomy && $taxonomy !== $_term->taxonomy ) { 772 // If there are two terms with the same ID, split the other one to a new term. 773 $new_term_id = _split_shared_term( $_term->term_id, $_term->term_taxonomy_id ); 774 775 // If no split occurred, this is an invalid request. Return null (not WP_Error) for back compat. 776 if ( $new_term_id === $_term->term_id ) { 777 return null; 778 779 // The term has been split. Refetch the term from the proper taxonomy. 780 } else { 781 return get_term( $_term->term_id, $taxonomy, $output, $filter ); 782 } 783 } 784 785 if ( ! $_term ) { 767 $_term = WP_Term::get_instance( $term, $taxonomy ); 768 } 769 770 if ( is_wp_error( $_term ) ) { 771 return $_term; 772 } elseif ( ! $_term ) { 786 773 return null; 787 774 }
Note: See TracChangeset
for help on using the changeset viewer.