[wp-trac] [WordPress Trac] #59677: Incorrect theme returned when switching to blog in multisite subsite

WordPress Trac noreply at wordpress.org
Thu Oct 19 16:55:47 UTC 2023


#59677: Incorrect theme returned when switching to blog in multisite subsite
--------------------------------------+------------------------------------
 Reporter:  codex-m                   |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  6.4
Component:  Networks and Sites        |     Version:  trunk
 Severity:  major                     |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite,
                                      |  performance
--------------------------------------+------------------------------------

Comment (by jeremyfelt):

 It seems like @codex-m has the right idea in
 [https://core.trac.wordpress.org/attachment/ticket/59677/patch3.diff
 patch3.diff], but I think we can move the nulling of that data to
 `switch_to_blog()` and `restore_current_blog()` so that it's only cleared
 once instead of every time `get_stylesheet_directory()` or
 `get_template_directory()` is called.

 I've added an attempt at this in [https://github.com/WordPress/wordpress-
 develop/pull/5532 PR#5532] with some tests that clarify what's happening.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59677#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list