[wp-trac] [WordPress Trac] #34338: wp_remove_object_terms() should call wp_cache_delete() like wp_set_object_terms()
WordPress Trac
noreply at wordpress.org
Sat Oct 17 10:43:04 UTC 2015
#34338: wp_remove_object_terms() should call wp_cache_delete() like
wp_set_object_terms()
--------------------------+-----------------------------
Reporter: tszming | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.3.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
If you call get_the_terms() after wp_remove_object_terms(), cached terms
will be returned.
Failed:
wp_remove_object_terms($id, 'test', 'mycategory');
$terms = get_the_terms($id, 'mycategory');
Ok:
wp_set_object_terms($id, null, 'mycategory');
$terms = get_the_terms($id, 'mycategory');
wp_cache_delete() need to be place inside the wp_remove_object_terms()
like wp_remove_object_terms()
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34338>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list