Make WordPress Core

Changeset 18560


Ignore:
Timestamp:
08/17/2011 05:49:57 PM (13 years ago)
Author:
nacin
Message:

Instantiate some MS variables as objects before using them. Spaces not tabs for vertical alignment. Remove unnecessary conditional piece. props PeteMall, see #18049.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r18524 r18560  
    2020    global $wpdb;
    2121
    22     $stats['blogs'] = get_blog_count();
    23     $stats['users'] = get_user_count();
     22    $stats = array(
     23        'blogs' => get_blog_count(),
     24        'users' => get_user_count(),
     25    );
    2426
    2527    return $stats;
  • trunk/wp-includes/user.php

    r18513 r18560  
    657657    if ( !is_multisite() ) {
    658658        $blog_id = get_current_blog_id();
    659         $blogs = array();
     659        $blogs = array( $blog_id => new stdClass );
    660660        $blogs[ $blog_id ]->userblog_id = $blog_id;
    661661        $blogs[ $blog_id ]->blogname = get_option('blogname');
     
    705705    foreach ( (array) $blogs as $blog_id ) {
    706706        $blog = get_blog_details( $blog_id );
    707         if ( $blog && isset( $blog->domain ) && ( $all == true || $all == false && ( $blog->archived == 0 && $blog->spam == 0 && $blog->deleted == 0 ) ) ) {
    708             $blog_deets[ $blog_id ]->userblog_id    = $blog_id;
    709             $blog_deets[ $blog_id ]->blogname       = $blog->blogname;
    710             $blog_deets[ $blog_id ]->domain     = $blog->domain;
    711             $blog_deets[ $blog_id ]->path           = $blog->path;
    712             $blog_deets[ $blog_id ]->site_id        = $blog->site_id;
    713             $blog_deets[ $blog_id ]->siteurl        = $blog->siteurl;
     707        if ( $blog && isset( $blog->domain ) && ( $all || ( $blog->archived == 0 && $blog->spam == 0 && $blog->deleted == 0 ) ) ) {
     708            $blog_deets[ $blog_id ] = new stdClass;
     709            $blog_deets[ $blog_id ]->userblog_id = $blog_id;
     710            $blog_deets[ $blog_id ]->blogname    = $blog->blogname;
     711            $blog_deets[ $blog_id ]->domain      = $blog->domain;
     712            $blog_deets[ $blog_id ]->path        = $blog->path;
     713            $blog_deets[ $blog_id ]->site_id     = $blog->site_id;
     714            $blog_deets[ $blog_id ]->siteurl     = $blog->siteurl;
    714715        }
    715716    }
Note: See TracChangeset for help on using the changeset viewer.