[wp-trac] [WordPress Trac] #18797: Rename restore_current_blog() to restore_previous_blog()

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 27 22:44:04 UTC 2011


#18797: Rename restore_current_blog() to restore_previous_blog()
--------------------------+----------------------------
 Reporter:  Viper007Bond  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  lowest        |  Milestone:  Future Release
Component:  Multisite     |    Version:  3.3
 Severity:  minor         |   Keywords:
--------------------------+----------------------------
 Contrary to it's name, `restore_current_blog()` does not restore the
 current blog but rather the previous blog. If you call `switch_to_blog()`
 twice and then call `restore_current_blog()`, then you won't end up with
 the original blog but rather with the blog after `switch_to_blog()` was
 called the first time.

 For clarity's sake, I suggest we rename `restore_current_blog()` to
 `restore_previous_blog()` and create a deprecated wrapped for it called
 `restore_current_blog()`.

 At the very least the PHPdoc should be updated to explain this.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18797>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list