Changeset 35850
- Timestamp:
- 12/10/2015 03:34:51 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r35293 r35850 1149 1149 if ( false === $terms ) { 1150 1150 $terms = wp_get_object_terms( $post->ID, $taxonomy ); 1151 $to_cache = array(); 1152 foreach ( $terms as $key => $term ) { 1153 $to_cache[ $key ] = $term->data; 1154 } 1155 wp_cache_add( $post->ID, $to_cache, $taxonomy . '_relationships' ); 1156 } 1157 1158 $terms = array_map( 'get_term', $terms ); 1151 if ( ! is_wp_error( $terms ) ) { 1152 $to_cache = array(); 1153 foreach ( $terms as $key => $term ) { 1154 $to_cache[ $key ] = $term->data; 1155 } 1156 wp_cache_add( $post->ID, $to_cache, $taxonomy . '_relationships' ); 1157 } 1158 } 1159 1160 if ( ! is_wp_error( $terms ) ) { 1161 $terms = array_map( 'get_term', $terms ); 1162 } 1159 1163 1160 1164 /** -
trunk/tests/phpunit/tests/term.php
r35246 r35850 628 628 $this->assertWPError( $cat_id2 ); 629 629 } 630 631 /** 632 * @ticket 34723 633 */ 634 function test_get_the_terms_should_return_wp_error_when_taxonomy_is_unregistered() { 635 $p = self::$post_ids[0]; 636 $terms = get_the_terms( $p, 'this-taxonomy-does-not-exist' ); 637 $this->assertTrue( is_wp_error( $terms ) ); 638 } 630 639 }
Note: See TracChangeset
for help on using the changeset viewer.