[wp-trac] [WordPress Trac] #60290: Changeset #56635 breaks template loading in multisite network using switch_to_blog()

WordPress Trac noreply at wordpress.org
Fri Jan 19 22:31:35 UTC 2024


#60290: Changeset #56635 breaks template loading in multisite network using
switch_to_blog()
-----------------------------+------------------------
 Reporter:  metropolis_john  |       Owner:  joemcgill
     Type:  defect (bug)     |      Status:  reviewing
 Priority:  normal           |   Milestone:  6.5
Component:  Themes           |     Version:  6.4.2
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:
-----------------------------+------------------------

Comment (by manfcarlo):

 At first glance, the change to `switch_to_blog` looks like a correction to
 me. You did say that `switch_to_blog` should only affect database calls,
 but the `template` and `stylesheet` options are themselves stored in the
 database, so I think it would be surprising if they don't get switched
 over.

 If I read your code correctly, it looks like you could easily solve the
 problem by appending user ID's that have posts to an array and calling
 `get_template_part` on each of them after you switch back to blog 2.

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


More information about the wp-trac mailing list