Changeset 34246
- Timestamp:
- 09/16/2015 06:49:28 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy-functions.php
r34217 r34246 804 804 } else { 805 805 $term = get_term( (int) $value, $taxonomy, $output, $filter ); 806 if ( is_wp_error( $term ) )806 if ( is_wp_error( $term ) || is_null( $term ) ) { 807 807 $term = false; 808 } 808 809 return $term; 809 810 } -
trunk/tests/phpunit/tests/term.php
r32507 r34246 56 56 $term2 = get_term_by( 'term_taxonomy_id', $term1['term_taxonomy_id'], 'category' ); 57 57 $this->assertEquals( get_term( $term1['term_id'], 'category' ), $term2 ); 58 } 59 60 /** 61 * @ticket 33281 62 */ 63 function test_get_term_by_with_nonexistent_id_should_return_false() { 64 $term = get_term_by( 'id', 123456, 'category' ); 65 $this->assertFalse( $term ); 58 66 } 59 67
Note: See TracChangeset
for help on using the changeset viewer.