Make WordPress Core


Ignore:
Timestamp:
07/07/2020 09:54:27 AM (6 years ago)
Author:
SergeyBiryukov
Message:

REST API: Correct the check for $version argument in rest_handle_doing_it_wrong().

Move WP_REST_Response and WP_Error class names out of the translatable string.

Follow-up to [48327], [48361].

See #36271.

File:
1 edited

Legend:

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

    r48361 r48367  
    40404040function wp_send_json( $response, $status_code = null ) {
    40414041        if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
    4042                 _doing_it_wrong( __FUNCTION__, __( 'Return a WP_REST_Response or WP_Error object from your callback when using the REST API.' ), '5.5.0' );
     4042                _doing_it_wrong(
     4043                        __FUNCTION__,
     4044                        sprintf(
     4045                                /* translators: 1: WP_REST_Response, 2: WP_Error */
     4046                                __( 'Return a %1$s or %2$s object from your callback when using the REST API.' ),
     4047                                'WP_REST_Response',
     4048                                'WP_Error'
     4049                        ),
     4050                        '5.5.0'
     4051                );
    40434052        }
    40444053
    … …  
    51855194                        trigger_error(
    51865195                                sprintf(
    5187                                         /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: Version information message. */
     5196                                        /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: WordPress version number. */
    51885197                                        __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ),
    51895198                                        $function,
Note: See TracChangeset for help on using the changeset viewer.