[wp-trac] [WordPress Trac] #19690: wp_suspend_cache_additions() doesn't block term_relationships with custom taxonomies
WordPress Trac
wp-trac at lists.automattic.com
Thu Dec 29 22:55:14 UTC 2011
#19690: wp_suspend_cache_additions() doesn't block term_relationships with custom
taxonomies
--------------------------+-----------------------------
Reporter: leewillis77 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cache | Version: 3.3
Severity: normal | Keywords:
--------------------------+-----------------------------
1. Register a custom taxonomy, and create one or more posts associated
with this taxonomy
2. Place the attached code in your theme's functions.php [Tweak the args
to get_posts accordingly to retrieve the posts created in (1)]
3. Load your blog and inspect your error log.
The output should confirm that while wp_suspend_cache_additions() blocks
most cache additions, cache entries are still added for
{$taxonomy}_relationships. E.g. in my case, the output is:
{{{
[29-Dec-2011 22:49:06] --------------
[29-Dec-2011 22:49:06] options - 6 items
[29-Dec-2011 22:49:06] default - 1 items
[29-Dec-2011 22:49:06] users - 1 items
[29-Dec-2011 22:49:06] userlogins - 1 items
[29-Dec-2011 22:49:06] useremail - 1 items
[29-Dec-2011 22:49:06] userslugs - 1 items
[29-Dec-2011 22:49:06] user_meta - 1 items
[29-Dec-2011 22:49:06] --------------
[29-Dec-2011 22:49:06] --------------
[29-Dec-2011 22:49:06] options - 6 items
[29-Dec-2011 22:49:06] default - 1 items
[29-Dec-2011 22:49:06] users - 1 items
[29-Dec-2011 22:49:06] userlogins - 1 items
[29-Dec-2011 22:49:06] useremail - 1 items
[29-Dec-2011 22:49:06] userslugs - 1 items
[29-Dec-2011 22:49:06] user_meta - 1 items
[29-Dec-2011 22:49:06] wpsc_product_category_relationships - 50 items
[29-Dec-2011 22:49:06] product_tag_relationships - 50 items
[29-Dec-2011 22:49:06] wpsc-variation_relationships - 50 items
[29-Dec-2011 22:49:06] wpec_product_option_relationships - 50 items
[29-Dec-2011 22:49:06] --------------
}}}
As you can see entries have been added to the cache for the various
{taxonomy}_relationships.
This appears to be either because the call to wp_cache_set inside
update_object_term_cache() in taxonomy.php should be wp_cache_add - and/or
wp_cache_set should check the value of wp_suspend_cache_additions() before
adding to the cache.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19690>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list