diff --git a/wp-includes/functions.php b/wp-includes/functions.php index b1f74c68ac..acc4a5057b 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -4039,7 +4039,16 @@ function _wp_json_prepare_data( $data ) { */ function wp_send_json( $response, $status_code = null ) { if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { - _doing_it_wrong( __FUNCTION__, __( 'Return a WP_REST_Response or WP_Error object from your callback when using the REST API.' ), '5.5.0' ); + _doing_it_wrong( + __FUNCTION__, + sprintf( + /* translators: 1: WP_REST_Response, 2: WP_Error */ + __( 'Return a %1$s or %2$s object from your callback when using the REST API.' ), + 'WP_REST_Response', + 'WP_Error' + ), + '5.5.0' + ); } if ( ! headers_sent() ) { @@ -5184,7 +5193,7 @@ function _doing_it_wrong( $function, $message, $version ) { trigger_error( sprintf( - /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: Version information message. */ + /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: WordPress version number. */ __( '%1$s was called incorrectly. %2$s %3$s' ), $function, $message, diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 6baef3df49..d3bb80a3d6 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -588,7 +588,7 @@ function rest_handle_deprecated_argument( $function, $message, $version ) { if ( ! WP_DEBUG || headers_sent() ) { return; } - if ( ! empty( $message ) ) { + if ( $message ) { /* translators: 1: Function name, 2: WordPress version number, 3: Error message. */ $string = sprintf( __( '%1$s (since %2$s; %3$s)' ), $function, $version, $message ); } else { @@ -613,14 +613,14 @@ function rest_handle_doing_it_wrong( $function, $message, $version ) { return; } - if ( is_null( $version ) ) { - /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message */ - $string = __( '%1$s (%2$s)' ); - $string = sprintf( $string, $function, $message ); - } else { - /* translators: Developer debugging message. 1: PHP function name, 2: Version information message, 3: Explanatory message. */ + if ( $version ) { + /* translators: Developer debugging message. 1: PHP function name, 2: WordPress version number, 3: Explanatory message. */ $string = __( '%1$s (since %2$s; %3$s)' ); $string = sprintf( $string, $function, $version, $message ); + } else { + /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message. */ + $string = __( '%1$s (%2$s)' ); + $string = sprintf( $string, $function, $message ); } header( sprintf( 'X-WP-DoingItWrong: %s', $string ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 1790e9998e..cd744e2be6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-48365'; +$wp_version = '5.5-alpha-48367'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.