[wp-trac] [WordPress Trac] #32450: WP_Site class
WordPress Trac
noreply at wordpress.org
Wed Aug 26 21:35:35 UTC 2015
#32450: WP_Site class
--------------------------------------+-----------------------------
Reporter: jeremyfelt | Owner: jeremyfelt
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future Release
Component: Networks and Sites | Version:
Severity: normal | Resolution:
Keywords: needs-patch dev-feedback | Focuses: multisite
--------------------------------------+-----------------------------
Comment (by BinaryKitten):
@jeremyfelt, I'd like to suggest the following additions:
* adding support to pass WP_Site to switch_to_blog
* adding a method "switch_to" to the WP_Site that would pass itself/id to
the switch_to_blog
this would allow for things like
{{{
switch_to_blog( get_site_by_path( 'mysitepath' ) );
}}}
or
{{{
$my_site = get_site_by_path( 'mysitepath' );
$my_site->switch_to();
}}}
both of which would end up performing the same code in the end, but allows
for promoting the WP_Site to a primary object.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32450#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list