Changeset 36323
- Timestamp:
- 01/15/2016 07:34:16 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r36252 r36323 3722 3722 foreach ( (array) $terms as $term ) { 3723 3723 // Create a copy in case the array was passed by reference. 3724 $_term = $term;3724 $_term = clone $term; 3725 3725 3726 3726 // Object ID should not be cached. -
trunk/tests/phpunit/tests/term/cache.php
r35242 r36323 201 201 _unregister_taxonomy( 'wptests_tax' ); 202 202 } 203 204 /** 205 * @ticket 35462 206 */ 207 public function test_term_objects_should_not_be_modified_by_update_term_cache() { 208 register_taxonomy( 'wptests_tax', 'post' ); 209 $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 210 $p = self::factory()->post->create(); 211 212 wp_set_object_terms( $p, $t, 'wptests_tax' ); 213 214 $terms = wp_get_object_terms( $p, 'wptests_tax', array( 'fields' => 'all_with_object_id' ) ); 215 216 update_term_cache( $terms ); 217 218 foreach ( $terms as $term ) { 219 $this->assertSame( $p, $term->object_id ); 220 } 221 } 203 222 }
Note: See TracChangeset
for help on using the changeset viewer.