Leave the 'Try Again' link for the wp_die() when the themes API fails. props solarissmoke, fixes #16132.

git-svn-id: https://develop.svn.wordpress.org/trunk@17264 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-01-12 00:18:23 +00:00
parent d848f25d95
commit 84e50d906f
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ class WP_Theme_Install_List_Table extends WP_List_Table {
$api = themes_api( 'query_themes', $args ); $api = themes_api( 'query_themes', $args );
if ( is_wp_error( $api ) ) if ( is_wp_error( $api ) )
wp_die( $api->get_error_message() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' ); wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
$this->items = $api->themes; $this->items = $api->themes;

View File

@ -391,7 +391,7 @@ function themes_api($action, $args = null) {
if ( ! $res ) { if ( ! $res ) {
$request = wp_remote_post('http://api.wordpress.org/themes/info/1.0/', array( 'body' => array('action' => $action, 'request' => serialize($args))) ); $request = wp_remote_post('http://api.wordpress.org/themes/info/1.0/', array( 'body' => array('action' => $action, 'request' => serialize($args))) );
if ( is_wp_error($request) ) { if ( is_wp_error($request) ) {
$res = new WP_Error('themes_api_failed', __('An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>'), $request->get_error_message() ); $res = new WP_Error('themes_api_failed', __('An Unexpected HTTP Error occurred during the API request.'), $request->get_error_message() );
} else { } else {
$res = unserialize($request['body']); $res = unserialize($request['body']);
if ( ! $res ) if ( ! $res )