Make WordPress Core


Ignore:
Timestamp:
11/21/2016 01:51:39 AM (10 years ago)
Author:
SergeyBiryukov
Message:

I18N: Move the support forums URL in update-related HTTP API error messages to a separate translatable string that is already used elsewhere.

Props ramiy, SergeyBiryukov.
Fixes #38880.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/theme.php

    r39140 r39325  
    463463                if ( $ssl && is_wp_error( $request ) ) {
    464464                        if ( ! wp_doing_ajax() ) {
    465                                 trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     465                                trigger_error(
     466                                        sprintf(
     467                                                /* translators: %s: support forums URL */
     468                                                __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
     469                                                __( 'https://wordpress.org/support/' )
     470                                        ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     471                                        headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     472                                );
    466473                        }
    467474                        $request = wp_remote_post( $http_url, $http_args );
    … …  
    469476
    470477                if ( is_wp_error($request) ) {
    471                         $res = new WP_Error('themes_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );
     478                        $res = new WP_Error( 'themes_api_failed',
     479                                sprintf(
     480                                        /* translators: %s: support forums URL */
     481                                        __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
     482                                        __( 'https://wordpress.org/support/' )
     483                                ),
     484                                $request->get_error_message()
     485                        );
    472486                } else {
    473487                        $res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
    474                         if ( ! is_object( $res ) && ! is_array( $res ) )
    475                                 $res = new WP_Error('themes_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) );
     488                        if ( ! is_object( $res ) && ! is_array( $res ) ) {
     489                                $res = new WP_Error( 'themes_api_failed',
     490                                        sprintf(
     491                                                /* translators: %s: support forums URL */
     492                                                __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
     493                                                __( 'https://wordpress.org/support/' )
     494                                        ),
     495                                        wp_remote_retrieve_body( $request )
     496                                );
     497                        }
    476498                }
    477499        }
Note: See TracChangeset for help on using the changeset viewer.