wp/wp-admin/includes/import.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
   134  * @since 3.5.0
   134  * @since 3.5.0
   135  *
   135  *
   136  * @return array Importers with metadata for each.
   136  * @return array Importers with metadata for each.
   137  */
   137  */
   138 function wp_get_popular_importers() {
   138 function wp_get_popular_importers() {
   139 	// Include an unmodified $wp_version.
       
   140 	require ABSPATH . WPINC . '/version.php';
       
   141 
       
   142 	$locale            = get_user_locale();
   139 	$locale            = get_user_locale();
   143 	$cache_key         = 'popular_importers_' . md5( $locale . $wp_version );
   140 	$cache_key         = 'popular_importers_' . md5( $locale . wp_get_wp_version() );
   144 	$popular_importers = get_site_transient( $cache_key );
   141 	$popular_importers = get_site_transient( $cache_key );
   145 
   142 
   146 	if ( ! $popular_importers ) {
   143 	if ( ! $popular_importers ) {
   147 		$url     = add_query_arg(
   144 		$url     = add_query_arg(
   148 			array(
   145 			array(
   149 				'locale'  => $locale,
   146 				'locale'  => $locale,
   150 				'version' => $wp_version,
   147 				'version' => wp_get_wp_version(),
   151 			),
   148 			),
   152 			'http://api.wordpress.org/core/importers/1.1/'
   149 			'http://api.wordpress.org/core/importers/1.1/'
   153 		);
   150 		);
   154 		$options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) );
   151 		$options = array( 'user-agent' => 'WordPress/' . wp_get_wp_version() . '; ' . home_url( '/' ) );
   155 
   152 
   156 		if ( wp_http_supports( array( 'ssl' ) ) ) {
   153 		if ( wp_http_supports( array( 'ssl' ) ) ) {
   157 			$url = set_url_scheme( $url, 'https' );
   154 			$url = set_url_scheme( $url, 'https' );
   158 		}
   155 		}
   159 
   156