[wp-trac] [WordPress Trac] #14080: Needless wp_cache_delete() inside set_theme_mod()

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 24 23:35:11 UTC 2010


#14080: Needless wp_cache_delete() inside set_theme_mod()
--------------------------+-------------------------------------------------
 Reporter:  shidouhikari  |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Cache         |     Version:            
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 In /wp-includes/theme.php, the function set_theme_mod() calls
 update_option("mods_$theme" and then wp_cache_delete("mods_$theme",
 'options').

 Is this cache delete really needed? Inside update_option() I see that it
 uses wp_cache_set( 'alloptions' or wp_cache_set( $option.

 I believe update_option(), add_option(), delete_option() etc should handle
 all option caches, from group 'options', and no other code anywhere else
 should need to bother with it, to avoid inconsistences.

 If set_theme_mod() doesn't need to edit cache and update_option() handles
 it, maybe wp_cache_delete() should be removed. And if set_theme_mod()
 indeed needs to handle it, maybe update_option() and other related
 functions should be fixed to handle it and avoid cache inconsistences.

 Also, since "mods_$theme" value is already known and accessible, a
 wp_cache_set() would be better than just deleting it.

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


More information about the wp-trac mailing list