[wp-trac] [WordPress Trac] #21270: Use update_blog_option() when enabling/disabling themes per site in Multisite

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 31 21:17:05 UTC 2012


#21270: Use update_blog_option() when enabling/disabling themes per site in
Multisite
--------------------------+-----------------------
 Reporter:  jeremyfelt    |       Owner:  ryan
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  3.5
Component:  Cache         |     Version:
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------

Comment (by ryan):

 nacin beat me to it. My comment:

 Actually, this can cause quite a few extra queries when running without a
 persistent cache. switch_to_blog() calls wp_cache_init() which obliterates
 the wp cache instance. With a persistent cache this simply means some
 extra cache trips to repopulate the local cache after calling
 restore_current_blog(). nacin and I discussed a softer init that maintains
 a stack of pointers to existing cache objects.

 These functions should be deprecated and
 switch_to_blog()/get_option()/restore_to_blog() should be used instead.
 This way multiple option calls can be done within one switch_to_blog()
 instead of switching and restoring for every *_blog_option() call.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21270#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list