REST API: Correct error code for the maxItems keyword.

Follow-up to [50007].

Props TimothyBlynJacobs.
Reviewed by desrosj, SergeyBiryukov.
Merges [50461] to the 5.7 branch.
Fixes #52317.

git-svn-id: https://develop.svn.wordpress.org/branches/5.7@50470 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-03-02 12:53:12 +00:00
parent 04c2acb024
commit 582df45458

View File

@ -2365,7 +2365,7 @@ function rest_validate_array_value_from_schema( $value, $args, $param ) {
if ( isset( $args['maxItems'] ) && count( $value ) > $args['maxItems'] ) {
return new WP_Error(
'test_too_many_items',
'rest_too_many_items',
/* translators: 1: Parameter, 2: Number. */
sprintf(
_n(