WordPress.org

Make WordPress Core

Changeset 46101


Ignore:
Timestamp:
09/13/2019 03:05:15 AM (2 years ago)
Author:
SergeyBiryukov
Message:

REST API: Use correct parameter name in rest_validate_value_from_schema() error messages.

Props manzoorwanijk.
Fixes #47905.

File:
1 edited

Legend:

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

    r46099 r46101  
    12161216    if ( 'boolean' === $args['type'] && ! rest_is_boolean( $value ) ) {
    12171217        /* translators: 1: Parameter, 2: Type name. */
    1218         return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $value, 'boolean' ) );
     1218        return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'boolean' ) );
    12191219    }
    12201220
     
    12401240                if ( ! rest_is_ip_address( $value ) ) {
    12411241                    /* translators: %s: IP address. */
    1242                     return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $value ) );
     1242                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $param ) );
    12431243                }
    12441244                break;
Note: See TracChangeset for help on using the changeset viewer.