Make WordPress Core


Ignore:
Timestamp:
11/21/2016 01:51:39 AM (9 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/plugin-install.php

    r38953 r39325  
    156156
    157157        if ( $ssl && is_wp_error( $request ) ) {
    158             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 );
     158            trigger_error(
     159                sprintf(
     160                    /* translators: %s: support forums URL */
     161                    __( '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>.' ),
     162                    __( 'https://wordpress.org/support/' )
     163                ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     164                headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     165            );
    159166            $request = wp_remote_post( $http_url, $http_args );
    160167        }
    161168
    162169        if ( is_wp_error($request) ) {
    163             $res = new WP_Error('plugins_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() );
     170            $res = new WP_Error( 'plugins_api_failed',
     171                sprintf(
     172                    /* translators: %s: support forums URL */
     173                    __( '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>.' ),
     174                    __( 'https://wordpress.org/support/' )
     175                ),
     176                $request->get_error_message()
     177            );
    164178        } else {
    165179            $res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
    166             if ( ! is_object( $res ) && ! is_array( $res ) )
    167                 $res = new WP_Error('plugins_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 ) );
     180            if ( ! is_object( $res ) && ! is_array( $res ) ) {
     181                $res = new WP_Error( 'plugins_api_failed',
     182                    sprintf(
     183                        /* translators: %s: support forums URL */
     184                        __( '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>.' ),
     185                        __( 'https://wordpress.org/support/' )
     186                    ),
     187                    wp_remote_retrieve_body( $request )
     188                );
     189            }
    168190        }
    169191    } elseif ( !is_wp_error($res) ) {
Note: See TracChangeset for help on using the changeset viewer.