[wp-trac] [WordPress Trac] #7213: get_terms caching ignores filters

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 30 18:20:23 GMT 2008


#7213: get_terms caching ignores filters
----------------------+-----------------------------------------------------
 Reporter:  filosofo  |       Owner:  anonymous                       
     Type:  defect    |      Status:  new                             
 Priority:  normal    |   Milestone:  2.6                             
Component:  General   |     Version:  2.6                             
 Severity:  normal    |    Keywords:  has-patch wp_cache_set get_terms
----------------------+-----------------------------------------------------
 get_terms sets the cache for a terms query, serializing the default query
 args and their values as the cache key, so that in theory there will be
 different cache keys for each get_terms query.

 However, get_terms calls wp_cache_set before the 'list_terms_exclusions'
 filter is called, meaning that anything done by those callbacks on that
 filter will not result in distinct cache keys.

 My patch serializes the callbacks for 'list_terms_exclusions', if there
 are any, and adds it to the cache key.

 I looked grepped through the rest of core WP and could not find any other
 similar situations, i.e. situations where the cache is set before filters
 are called.

 BTW, this bug was difficult to track down and so might be difficult to
 reproduce, because a number of different situations cause the cache to be
 flushed, meaning that the bug's appearance is sporadic.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7213>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list