Ticket #49265: 49265.diff
File 49265.diff, 2.0 KB (added by , 5 years ago) |
---|
-
src/wp-includes/ms-blogs.php
508 508 * Fires when the blog is switched. 509 509 * 510 510 * @since MU (3.0.0) 511 * @since 5.4.0 The `$context` parameter was added. 511 512 * 512 * @param int $new_blog_id New blog ID. 513 * @param int $prev_blog_id Previous blog ID. 513 * @param int $new_blog_id New blog ID. 514 * @param int $prev_blog_id Previous blog ID. 515 * @param string $context Additional context. Accepts 'switch' when called from switch_to_blog() 516 * or 'restore' when called from restore_current_blog(). 514 517 */ 515 do_action( 'switch_blog', $new_blog_id, $prev_blog_id );518 do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' ); 516 519 $GLOBALS['switched'] = true; 517 520 return true; 518 521 } … … 544 547 } 545 548 546 549 /** This filter is documented in wp-includes/ms-blogs.php */ 547 do_action( 'switch_blog', $new_blog_id, $prev_blog_id );550 do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' ); 548 551 $GLOBALS['switched'] = true; 549 552 550 553 return true; … … 577 580 578 581 if ( $new_blog_id == $prev_blog_id ) { 579 582 /** This filter is documented in wp-includes/ms-blogs.php */ 580 do_action( 'switch_blog', $new_blog_id, $prev_blog_id );583 do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' ); 581 584 // If we still have items in the switched stack, consider ourselves still 'switched' 582 585 $GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] ); 583 586 return true; … … 611 614 } 612 615 613 616 /** This filter is documented in wp-includes/ms-blogs.php */ 614 do_action( 'switch_blog', $new_blog_id, $prev_blog_id );617 do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' ); 615 618 616 619 // If we still have items in the switched stack, consider ourselves still 'switched' 617 620 $GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );