[wp-trac] [WordPress Trac] #45594: Action 'switch_blog' duplicated $new_blog param

WordPress Trac noreply at wordpress.org
Wed Dec 12 17:14:06 UTC 2018


#45594: Action 'switch_blog' duplicated $new_blog param
-------------------------------------+-----------------------------
 Reporter:  ChriCo                   |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Networks and Sites       |     Version:  5.0
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  multisite
-------------------------------------+-----------------------------
Changes (by jeremyfelt):

 * focuses:   => multisite
 * milestone:  Awaiting Review => Future Release


Comment:

 Thanks, @ChriCo, some consistency in docs and parameters makes sense here.
 I'm wondering if we can do this with a smaller change.

 The `$prev_blog_id` parameter was populated with `$GLOBALS['blog_id']`
 until [38457]. It now serves less of a purpose because there is no worry
 of the global being overwritten on the next line.

 I think we can remove `$prev_blog_id` entirely and change both action
 calls to `do_action( 'switch_blog', $new_blog, $blog_id );`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45594#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list