WordPress.org

Make WordPress Core

Ticket #16132: 16132.patch

File 16132.patch, 1.6 KB (added by solarissmoke, 3 years ago)

Don't print duplicate "try again" links when themes_api fails

  • wp-admin/includes/class-wp-theme-install-list-table.php

     
    9494                $api = themes_api( 'query_themes', $args ); 
    9595 
    9696                if ( is_wp_error( $api ) ) 
    97                         wp_die( $api->get_error_message() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' ); 
     97                        wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' ); 
    9898 
    9999                $this->items = $api->themes; 
    100100 
  • wp-admin/includes/theme.php

     
    389389        if ( ! $res ) { 
    390390                $request = wp_remote_post('http://api.wordpress.org/themes/info/1.0/', array( 'body' => array('action' => $action, 'request' => serialize($args))) ); 
    391391                if ( is_wp_error($request) ) { 
    392                         $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() ); 
     392                        $res = new WP_Error('themes_api_failed', __('An Unexpected HTTP Error occurred during the API request.'), $request->get_error_message() ); 
    393393                } else { 
    394394                        $res = unserialize($request['body']); 
    395395                        if ( ! $res )