The typical answer to anything switch_to_blog()
is — no it shouldn’t, yes it is a mess. Simply put WP architecture doesn’t posses the capability of making such clean switch from one blog to another in the runtime. It’s a bit of wishful thinking — some things work, some very much break.
In your specific case it is a little puzzling why would query–related hooks fire, since the switch itself shouldn’t involve querying posts. The most reliable would be to dump how they are called up, for example using wp_debug_backtrace_summary()
.
Related Posts:
- How can I trust switch_to_blog()?
- Sharing Dynamic Sidebars across Multisite Blogs
- Hook filter to change wp_upload_dir() path in multisite
- latest 5 posts using switch_to_blog loop
- WordPress 3.2(Multisite) – How to add custom user meta fields to signup form?
- Switch_to_blog() outside wordpress
- why when I try to insert an image attachment along with a post does wp_get_attachment_url give me a very wrong file path?
- Upload images from one site to another in Multisite
- Limit entries number on network/sites.php
- What is the way to share data between sites in a multisite
- get post id by $content (so by post content)
- Cannot use pre_set_site_transient_update_themes from within a theme in multisite
- Register submenu on network menu from the subsite
- Conditional Image Sizes for Use via Theme Customizer Upload Only
- Include Site 1 Posts in Query for Sub Sites
- Sort posts according to date
- Multisite switch to blog
- Best Practise: Linking to WPMU sites from other sites
- Trouble with SQL SELECT inside switch_to_blog()
- Display posts from one network site on another
- Get variable from previous blog while using switch_to_blog
- Shared upload folder in wordpress multisite with custom sub site domain pictures URL:s
- switch_to_blog($blog_id); still writing to main blog
- fatal Error undefined function switch_to_blog()
- How to get all pages on specific blog after switch_to_blog?
- Access from template info of another blog (in the same network)
- How to disable style filtering in post?
- Get the excerpt by page ID from another blog in a wordpress multisite?
- The wpmu_blogs_columns filter is not working
- Redirect to Multisite site 2 if site 1 has a setting
- Site Redirecting to wp-signup.php
- Are nested subdomains possible with a subdomain multisite?
- Querying posts from multiple sites in a network?
- is_front_page() malfunction?
- How can I diagnose a slow WordPress admin?
- How to enable a site administrator to edit users in a WordPress network/ multisite setup?
- BLOG_ID_CURRENT_SITE vs. SITE_ID_CURRENT_SITE in WordPress Multisite?
- Shared table across network
- Turn off ms-files.php after network setup
- Opinions whether to go multisite VS 3 separate WP installation [closed]
- Multisite: differences between subdomain and subdirectory mode? Can it be switch after installation?
- Multisite – how to remove the root ‘/’ site?
- How do I fix problems with users not being able to publish and only submit for review after upgrade of Multisites installation?
- WordPress multisite with domain mapping and virtual host on local with fake domain
- Don’t allow access to wp-admin but allow admin-ajax requests to be fulfilled on frontend?
- subdomain archiving
- Full Domain Mapping with WP3 in Multiuser Mode
- Copy site from one multisite to another
- add_rewrite_rule not registering on Multisite
- How to combine multiple sites to WordPress MU
- how do I configure nginx for wordpress multisite, it occurs ERR_TOO_MANY_REDIRECTS
- Installing multisite network admin on sub-domain
- Getting blank thumbnails in media library?
- Multiple homes for multiple languages [closed]
- multisite custom directory
- You do not have permission to edit this user
- restore_current_blog required after switch_to_blog, if I use that in a function?
- Query users by capability – uninstall/deactivate callback
- Cannot access my first sub-site in a multisite [closed]
- Multisite setup help – plain domain/subsite always redirects to domain with subdir multisite
- Auto creation of multisite blog on user registration
- Issues with Multisite installation and 403 error for REST API request
- How to run react app and headless WordPress and React App on same server (managed by plesk)?
- How to disable wordpress cron jobs for a subsite?
- WordPress Mulitisite – Unable to create directory
- network site domain mapping still applied after being removed
- Can WordPress Multisite (MU) subdirectory url/slug/permalink be changed?
- Multisite Subdomain Redirect Mask
- How to use HyperDB plugin in a existing wpmu
- Add access control origin header information across multisite
- Get post by term from custom taxonomy in another blog on the network?
- Multi Network plugin: “Network not created” [closed]
- Https and Http Login Issue on WordPress Multisite
- How can I use different domains on a WP multisite install?
- Multisite network admin – User’s role not showing up
- Is it possible to install WordPress MU on a subdomain?
- WordPress multisite with same content
- Redirecting to page not found mulitiste
- How many .htaccess files should a WordPress multisite (subdirectory set up) have?
- Multisite and Multidomains WordPress
- mu activate / deactivate plugins in multisite network mode only
- Is there any hook to validate google recaptcha dislayed in wp-signup page [in WordPress Multisite]
- Primary (root) blog of multisite installation forbidden (403)
- How do I split a single WPML site with 6 languages (English is Main) into Multisite with 5 subfolders
- WordPress Multisite with Subdomain, make the subdomain look like another domain
- How To Upload Existing WordPress Site To WordPress Multisite Using SSH
- Change header.php of a specific WordPress Multisite
- WordPress multisite dashboard not working..!
- Parse shortcodes from another site in WP Multisite
- Custom pages on all multisite network, to NOT show in wp-admin at all
- In a MS install, can you allow different users to have their own themes?
- Install WordPress MU outside htdocs
- Redirect authors from upload.php url to Home page in Multisite
- Images on WP Network’s subsite appear only if accessed via main site’s url
- WordPress Multisite platform for different city for single db
- Multisite: should /blog go to a 404 page?
- Not being allowed to use some terms in Add New Site in WordPress
- How to redirect root blog to a specific one in multilang WP?
- WPML is blocking WP core update
- Multisite: Redirect a deleted site – Best practice?