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

git-svn-id: http://svn.automattic.com/wordpress/trunk@18560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-08-17 17:49:57 +00:00
parent ec3476720e
commit e53fe816b2
2 changed files with 13 additions and 10 deletions

View File

@ -19,8 +19,10 @@
function get_sitestats() {
global $wpdb;
$stats['blogs'] = get_blog_count();
$stats['users'] = get_user_count();
$stats = array(
'blogs' => get_blog_count(),
'users' => get_user_count(),
);
return $stats;
}

View File

@ -656,7 +656,7 @@ function get_blogs_of_user( $id, $all = false ) {
if ( !is_multisite() ) {
$blog_id = get_current_blog_id();
$blogs = array();
$blogs = array( $blog_id => new stdClass );
$blogs[ $blog_id ]->userblog_id = $blog_id;
$blogs[ $blog_id ]->blogname = get_option('blogname');
$blogs[ $blog_id ]->domain = '';
@ -704,13 +704,14 @@ function get_blogs_of_user( $id, $all = false ) {
$blog_deets = array();
foreach ( (array) $blogs as $blog_id ) {
$blog = get_blog_details( $blog_id );
if ( $blog && isset( $blog->domain ) && ( $all == true || $all == false && ( $blog->archived == 0 && $blog->spam == 0 && $blog->deleted == 0 ) ) ) {
$blog_deets[ $blog_id ]->userblog_id = $blog_id;
$blog_deets[ $blog_id ]->blogname = $blog->blogname;
$blog_deets[ $blog_id ]->domain = $blog->domain;
$blog_deets[ $blog_id ]->path = $blog->path;
$blog_deets[ $blog_id ]->site_id = $blog->site_id;
$blog_deets[ $blog_id ]->siteurl = $blog->siteurl;
if ( $blog && isset( $blog->domain ) && ( $all || ( $blog->archived == 0 && $blog->spam == 0 && $blog->deleted == 0 ) ) ) {
$blog_deets[ $blog_id ] = new stdClass;
$blog_deets[ $blog_id ]->userblog_id = $blog_id;
$blog_deets[ $blog_id ]->blogname = $blog->blogname;
$blog_deets[ $blog_id ]->domain = $blog->domain;
$blog_deets[ $blog_id ]->path = $blog->path;
$blog_deets[ $blog_id ]->site_id = $blog->site_id;
$blog_deets[ $blog_id ]->siteurl = $blog->siteurl;
}
}