Move to JSON for three api.wordpress.org endpoints. see #25311.
Built from https://develop.svn.wordpress.org/trunk@25441 git-svn-id: http://core.svn.wordpress.org/trunk@25362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a7b26bd103
commit
fef6081046
|
@ -20,12 +20,12 @@ function wp_credits() {
|
|||
if ( ! is_array( $results )
|
||||
|| ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
|
||||
) {
|
||||
$response = wp_remote_get( "http://api.wordpress.org/core/credits/1.0/?version=$wp_version&locale=$locale" );
|
||||
$response = wp_remote_get( "http://api.wordpress.org/core/credits/1.1/?version=$wp_version&locale=$locale" );
|
||||
|
||||
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
|
||||
return false;
|
||||
|
||||
$results = maybe_unserialize( wp_remote_retrieve_body( $response ) );
|
||||
$results = json_decode( wp_remote_retrieve_body( $response ), true );
|
||||
|
||||
if ( ! is_array( $results ) )
|
||||
return false;
|
||||
|
|
|
@ -1226,7 +1226,7 @@ function wp_check_browser_version() {
|
|||
'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url()
|
||||
);
|
||||
|
||||
$response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.0/', $options );
|
||||
$response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.1/', $options );
|
||||
|
||||
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
|
||||
return false;
|
||||
|
@ -1242,7 +1242,7 @@ function wp_check_browser_version() {
|
|||
* 'img_src' - string - An image representing the browser
|
||||
* 'img_src_ssl' - string - An image (over SSL) representing the browser
|
||||
*/
|
||||
$response = maybe_unserialize( wp_remote_retrieve_body( $response ) );
|
||||
$response = json_decode( wp_remote_retrieve_body( $response ), true );
|
||||
|
||||
if ( ! is_array( $response ) )
|
||||
return false;
|
||||
|
|
|
@ -108,10 +108,10 @@ function wp_get_popular_importers() {
|
|||
$popular_importers = get_site_transient( 'popular_importers_' . $locale );
|
||||
|
||||
if ( ! $popular_importers ) {
|
||||
$url = add_query_arg( 'locale', get_locale(), 'http://api.wordpress.org/core/importers/1.0/' );
|
||||
$url = add_query_arg( 'locale', get_locale(), 'http://api.wordpress.org/core/importers/1.1/' );
|
||||
$options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url() );
|
||||
$response = wp_remote_get( $url, $options );
|
||||
$popular_importers = maybe_unserialize( wp_remote_retrieve_body( $response ) );
|
||||
$popular_importers = json_decode( wp_remote_retrieve_body( $response ), true );
|
||||
|
||||
if ( is_array( $popular_importers ) )
|
||||
set_site_transient( 'popular_importers_' . $locale, $popular_importers, 2 * DAY_IN_SECONDS );
|
||||
|
|
Loading…
Reference in New Issue