Make WordPress Core


Ignore:
Timestamp:
07/07/2020 09:54:27 AM (5 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/rest-api.php

    r48361 r48367  
    589589        return;
    590590    }
    591     if ( ! empty( $message ) ) {
     591    if ( $message ) {
    592592        /* translators: 1: Function name, 2: WordPress version number, 3: Error message. */
    593593        $string = sprintf( __( '%1$s (since %2$s; %3$s)' ), $function, $version, $message );
     
    614614    }
    615615
    616     if ( is_null( $version ) ) {
    617         /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message */
     616    if ( $version ) {
     617        /* translators: Developer debugging message. 1: PHP function name, 2: WordPress version number, 3: Explanatory message. */
     618        $string = __( '%1$s (since %2$s; %3$s)' );
     619        $string = sprintf( $string, $function, $version, $message );
     620    } else {
     621        /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message. */
    618622        $string = __( '%1$s (%2$s)' );
    619623        $string = sprintf( $string, $function, $message );
    620     } else {
    621         /* translators: Developer debugging message. 1: PHP function name, 2: Version information message, 3: Explanatory message. */
    622         $string = __( '%1$s (since %2$s; %3$s)' );
    623         $string = sprintf( $string, $function, $version, $message );
    624624    }
    625625
Note: See TracChangeset for help on using the changeset viewer.