wp/wp-includes/update.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    78 	} else {
    78 	} else {
    79 		$mysql_version = 'N/A';
    79 		$mysql_version = 'N/A';
    80 	}
    80 	}
    81 
    81 
    82 	if ( is_multisite() ) {
    82 	if ( is_multisite() ) {
    83 		$user_count        = get_user_count();
       
    84 		$num_blogs         = get_blog_count();
    83 		$num_blogs         = get_blog_count();
    85 		$wp_install        = network_site_url();
    84 		$wp_install        = network_site_url();
    86 		$multisite_enabled = 1;
    85 		$multisite_enabled = 1;
    87 	} else {
    86 	} else {
    88 		$user_count        = count_users();
       
    89 		$user_count        = $user_count['total_users'];
       
    90 		$multisite_enabled = 0;
    87 		$multisite_enabled = 0;
    91 		$num_blogs         = 1;
    88 		$num_blogs         = 1;
    92 		$wp_install        = home_url( '/' );
    89 		$wp_install        = home_url( '/' );
    93 	}
    90 	}
    94 
    91 
    97 		'php'                => $php_version,
    94 		'php'                => $php_version,
    98 		'locale'             => $locale,
    95 		'locale'             => $locale,
    99 		'mysql'              => $mysql_version,
    96 		'mysql'              => $mysql_version,
   100 		'local_package'      => isset( $wp_local_package ) ? $wp_local_package : '',
    97 		'local_package'      => isset( $wp_local_package ) ? $wp_local_package : '',
   101 		'blogs'              => $num_blogs,
    98 		'blogs'              => $num_blogs,
   102 		'users'              => $user_count,
    99 		'users'              => get_user_count(),
   103 		'multisite_enabled'  => $multisite_enabled,
   100 		'multisite_enabled'  => $multisite_enabled,
   104 		'initial_db_version' => get_site_option( 'initial_db_version' ),
   101 		'initial_db_version' => get_site_option( 'initial_db_version' ),
   105 	);
   102 	);
   106 
   103 
   107 	/**
   104 	/**
   141 		&& in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc', 'development', 'branch-development' ), true )
   138 		&& in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc', 'development', 'branch-development' ), true )
   142 	) {
   139 	) {
   143 		$query['channel'] = WP_AUTO_UPDATE_CORE;
   140 		$query['channel'] = WP_AUTO_UPDATE_CORE;
   144 	}
   141 	}
   145 
   142 
   146 	$url      = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
   143 	$url      = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, '', '&' );
   147 	$http_url = $url;
   144 	$http_url = $url;
   148 	$ssl      = wp_http_supports( array( 'ssl' ) );
   145 	$ssl      = wp_http_supports( array( 'ssl' ) );
   149 
   146 
   150 	if ( $ssl ) {
   147 	if ( $ssl ) {
   151 		$url = set_url_scheme( $url, 'https' );
   148 		$url = set_url_scheme( $url, 'https' );
   515 		} else {
   512 		} else {
   516 			$updates->no_update[ $plugin_file ] = $update;
   513 			$updates->no_update[ $plugin_file ] = $update;
   517 		}
   514 		}
   518 	}
   515 	}
   519 
   516 
   520 	$sanitize_plugin_update_payload = function( &$item ) {
   517 	$sanitize_plugin_update_payload = static function( &$item ) {
   521 		$item = (object) $item;
   518 		$item = (object) $item;
   522 
   519 
   523 		unset( $item->translations, $item->compatibility );
   520 		unset( $item->translations, $item->compatibility );
   524 
   521 
   525 		return $item;
   522 		return $item;
   566 
   563 
   567 	$themes  = array();
   564 	$themes  = array();
   568 	$checked = array();
   565 	$checked = array();
   569 	$request = array();
   566 	$request = array();
   570 
   567 
   571 	// Put slug of current theme into request.
   568 	// Put slug of active theme into request.
   572 	$request['active'] = get_option( 'stylesheet' );
   569 	$request['active'] = get_option( 'stylesheet' );
   573 
   570 
   574 	foreach ( $installed_themes as $theme ) {
   571 	foreach ( $installed_themes as $theme ) {
   575 		$checked[ $theme->get_stylesheet() ] = $theme->get( 'Version' );
   572 		$checked[ $theme->get_stylesheet() ] = $theme->get( 'Version' );
   576 
   573