Changeset 35227
- Timestamp:
- 10/16/2015 09:41:51 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy-functions.php
r35170 r35227 752 752 $new_term_id = _split_shared_term( $_term->term_id, $_term->term_taxonomy_id ); 753 753 754 // If no split occurred, this is an invalid request. 754 // If no split occurred, this is an invalid request. Return null (not WP_Error) for back compat. 755 755 if ( $new_term_id === $_term->term_id ) { 756 return n ew WP_Error( 'invalid_term', __( 'Empty Term' ) );756 return null; 757 757 758 758 // The term has been split. Refetch the term from the proper taxonomy. -
trunk/tests/phpunit/tests/term/getTerm.php
r35225 r35227 107 107 $this->assertInternalType( 'int', $found->term_group ); 108 108 } 109 110 /** 111 * @ticket 34332 112 */ 113 public function test_should_return_null_when_provided_taxonomy_does_not_match_actual_term_taxonomy() { 114 $term_id = self::$factory->term->create( array( 'taxonomy' => 'post_tag' ) ); 115 $this->assertNull( get_term( $term_id, 'category' ) ); 116 } 109 117 }
Note: See TracChangeset
for help on using the changeset viewer.