[wp-trac] [WordPress Trac] #14418: Introduce restore_original_blog()
WordPress Trac
wp-trac at lists.automattic.com
Wed Jun 29 17:38:39 UTC 2011
#14418: Introduce restore_original_blog()
-----------------------------------------------+---------------------------
Reporter: nacin | Owner:
Type: enhancement | Status: new
Priority: lowest | Milestone: Future
Component: Multisite | Release
Severity: normal | Version:
Keywords: has-patch needs-testing 3.2-early | Resolution:
-----------------------------------------------+---------------------------
Comment (by cgrymala):
If you really are rolling all the way back to the original blog, I don't
see any reason to loop through the `$switched_stack`. Instead, you could
just use `array_shift()` on the `$switched_stack` instead of `array_pop()`
within the `restore_current_blog()` function and empty out the
`$switched_stack` var at the end of the function to accomplish the same
end result.
I just added a patch that shows that approach. It adds an optional
parameter to the `restore_current_blog()` function, and then makes the
changes I mentioned above if that switch is set to `true`.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14418#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list