WordPress.org

Make WordPress Core

Changeset 21581


Ignore:
Timestamp:
08/22/2012 03:34:00 AM (9 years ago)
Author:
ryan
Message:

Resurrect the switched global. Some are still using it. see #21459

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-blogs.php

    r21561 r21581  
    463463    if ( $new_blog == $GLOBALS['blog_id'] ) {
    464464        do_action( 'switch_blog', $new_blog, $new_blog );
    465         $GLOBALS['_wp_switched'] = true;
     465        $GLOBALS['switched'] = true;
    466466        return true;
    467467    }
     
    500500
    501501    do_action( 'switch_blog', $new_blog, $prev_blog_id );
    502     $GLOBALS['_wp_switched'] = true;
     502    $GLOBALS['switched'] = true;
    503503
    504504    return true;
     
    516516    global $wpdb, $wp_roles;
    517517
    518     if ( ! $GLOBALS['_wp_switched'] )
     518    if ( ! $GLOBALS['switched'] )
    519519        return false;
    520520
     
    524524        do_action( 'switch_blog', $blog, $blog );
    525525        // If we still have items in the switched stack, consider ourselves still 'switched'
    526         $GLOBALS['_wp_switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );
     526        $GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );
    527527        return true;
    528528    }
     
    563563
    564564    // If we still have items in the switched stack, consider ourselves still 'switched'
    565     $GLOBALS['_wp_switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );
     565    $GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );
    566566
    567567    return true;
     
    576576 */
    577577function ms_is_switched() {
    578     return $GLOBALS['_wp_switched'];
     578    return $GLOBALS['switched'];
    579579}
    580580
  • trunk/wp-includes/ms-settings.php

    r21485 r21581  
    128128$table_prefix = $wpdb->get_blog_prefix();
    129129$_wp_switched_stack = array();
    130 $_wp_switched = false;
     130$switched = false;
    131131
    132132// need to init cache again after blog_id is set
Note: See TracChangeset for help on using the changeset viewer.