[wp-trac] [WordPress Trac] #40513: switch_to_blog should accept a WP_site as param
WordPress Trac
noreply at wordpress.org
Sat Apr 22 11:46:09 UTC 2017
#40513: switch_to_blog should accept a WP_site as param
-----------------------------------+------------------------------
Reporter: spacedmonkey | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion | Focuses: multisite
-----------------------------------+------------------------------
Comment (by flixos90):
+1
We should have a close look at the parameter names and documentation in
order to clarify that `$site_object` may not actually contain a site
object. I have to admit that appears a bit confusing.
Maybe this is a good time to introduce a new `switch_site` action and only
run it if an object is passed. If a plugin developer then wants to do
something with the site object, they'd need to use the `switch_site`
action. If we ever introduce a function `switch_to_site()` or so, we could
then have it require an object - this is of course future stuff, but such
an action would bring something like forward compatibility. :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40513#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list