IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
1636 | 1636 | function switch_to_blog( $new_blog, $deprecated = null ) { |
1637 | 1637 | global $wpdb; |
1638 | 1638 | |
1639 | | $blog_id = get_current_blog_id(); |
| 1639 | $prev_blog_id = get_current_blog_id(); |
1640 | 1640 | if ( empty( $new_blog ) ) { |
1641 | | $new_blog = $blog_id; |
| 1641 | $new_blog = $prev_blog_id; |
1642 | 1642 | } |
1643 | 1643 | |
1644 | | $GLOBALS['_wp_switched_stack'][] = $blog_id; |
| 1644 | $GLOBALS['_wp_switched_stack'][] = $prev_blog_id; |
1645 | 1645 | |
1646 | 1646 | /* |
1647 | 1647 | * If we're switching to the same blog id that we're on, |
1648 | 1648 | * set the right vars, do the associated actions, but skip |
1649 | 1649 | * the extra unnecessary work |
1650 | 1650 | */ |
1651 | | if ( $new_blog == $blog_id ) { |
| 1651 | if ( $new_blog == $prev_blog_id ) { |
1652 | 1652 | /** |
1653 | 1653 | * Fires when the blog is switched. |
1654 | 1654 | * |
1655 | 1655 | * @since MU (3.0.0) |
1656 | 1656 | * |
1657 | 1657 | * @param int $new_blog New blog ID. |
1658 | | * @param int $new_blog Blog ID. |
| 1658 | * @param int $prev_blog_id Previous blog ID. |
1659 | 1659 | */ |
1660 | | do_action( 'switch_blog', $new_blog, $new_blog ); |
| 1660 | do_action( 'switch_blog', $new_blog, $prev_blog_id ); |
1661 | 1661 | $GLOBALS['switched'] = true; |
1662 | 1662 | return true; |
1663 | 1663 | } |
1664 | 1664 | |
1665 | 1665 | $wpdb->set_blog_id( $new_blog ); |
1666 | 1666 | $GLOBALS['table_prefix'] = $wpdb->get_blog_prefix(); |
1667 | | $prev_blog_id = $blog_id; |
1668 | 1667 | $GLOBALS['blog_id'] = $new_blog; |
1669 | 1668 | |
1670 | 1669 | if ( function_exists( 'wp_cache_switch_to_blog' ) ) { |