Needless wp_cache_delete() inside set_theme_mod()
|Reported by:||shidouhikari||Owned by:|
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.