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:
parent
ec3476720e
commit
e53fe816b2
|
@ -19,8 +19,10 @@
|
||||||
function get_sitestats() {
|
function get_sitestats() {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
$stats['blogs'] = get_blog_count();
|
$stats = array(
|
||||||
$stats['users'] = get_user_count();
|
'blogs' => get_blog_count(),
|
||||||
|
'users' => get_user_count(),
|
||||||
|
);
|
||||||
|
|
||||||
return $stats;
|
return $stats;
|
||||||
}
|
}
|
||||||
|
|
|
@ -656,7 +656,7 @@ function get_blogs_of_user( $id, $all = false ) {
|
||||||
|
|
||||||
if ( !is_multisite() ) {
|
if ( !is_multisite() ) {
|
||||||
$blog_id = get_current_blog_id();
|
$blog_id = get_current_blog_id();
|
||||||
$blogs = array();
|
$blogs = array( $blog_id => new stdClass );
|
||||||
$blogs[ $blog_id ]->userblog_id = $blog_id;
|
$blogs[ $blog_id ]->userblog_id = $blog_id;
|
||||||
$blogs[ $blog_id ]->blogname = get_option('blogname');
|
$blogs[ $blog_id ]->blogname = get_option('blogname');
|
||||||
$blogs[ $blog_id ]->domain = '';
|
$blogs[ $blog_id ]->domain = '';
|
||||||
|
@ -704,13 +704,14 @@ function get_blogs_of_user( $id, $all = false ) {
|
||||||
$blog_deets = array();
|
$blog_deets = array();
|
||||||
foreach ( (array) $blogs as $blog_id ) {
|
foreach ( (array) $blogs as $blog_id ) {
|
||||||
$blog = get_blog_details( $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 ) ) ) {
|
if ( $blog && isset( $blog->domain ) && ( $all || ( $blog->archived == 0 && $blog->spam == 0 && $blog->deleted == 0 ) ) ) {
|
||||||
$blog_deets[ $blog_id ]->userblog_id = $blog_id;
|
$blog_deets[ $blog_id ] = new stdClass;
|
||||||
$blog_deets[ $blog_id ]->blogname = $blog->blogname;
|
$blog_deets[ $blog_id ]->userblog_id = $blog_id;
|
||||||
$blog_deets[ $blog_id ]->domain = $blog->domain;
|
$blog_deets[ $blog_id ]->blogname = $blog->blogname;
|
||||||
$blog_deets[ $blog_id ]->path = $blog->path;
|
$blog_deets[ $blog_id ]->domain = $blog->domain;
|
||||||
$blog_deets[ $blog_id ]->site_id = $blog->site_id;
|
$blog_deets[ $blog_id ]->path = $blog->path;
|
||||||
$blog_deets[ $blog_id ]->siteurl = $blog->siteurl;
|
$blog_deets[ $blog_id ]->site_id = $blog->site_id;
|
||||||
|
$blog_deets[ $blog_id ]->siteurl = $blog->siteurl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue