[wp-trac] [WordPress Trac] #63768: WP_Query will generate an unexpected SQL query when using switch_to_blog and post_type = any

WordPress Trac noreply at wordpress.org
Fri Aug 15 10:38:01 UTC 2025


#63768: WP_Query will generate an unexpected SQL query when using switch_to_blog
and post_type = any
--------------------------+------------------------------
 Reporter:  mbmjertan     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by adrianlda):

 Further to the original posted issue which I can confirm having the same
 issue,

 The same is also true of the internal global $wp_taxonomies, so if you
 switch blogs then try and do any kind of Taxonomy functionality, they are
 tested and run against the list of the original blog and not the one you
 have switched to.

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


More information about the wp-trac mailing list