Changeset 47923 for trunk/src/wp-includes/rest-api.php
- Timestamp:
- 06/07/2020 10:40:16 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r47849 r47923 1251 1251 * Support the "minLength", "maxLength" and "pattern" keywords for strings. 1252 1252 * Validate required properties. 1253 * Support the "minItems" and "maxItems" keywords for arrays. 1253 1254 * 1254 1255 * @param mixed $value The value to validate. … … 1287 1288 return $is_valid; 1288 1289 } 1290 } 1291 1292 if ( isset( $args['minItems'] ) && count( $value ) < $args['minItems'] ) { 1293 /* translators: 1: Parameter, 2: number. */ 1294 return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at least %2$s items.' ), $param, number_format_i18n( $args['minItems'] ) ) ); 1295 } 1296 1297 if ( isset( $args['maxItems'] ) && count( $value ) > $args['maxItems'] ) { 1298 /* translators: 1: Parameter, 2: number. */ 1299 return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must contain at most %2$s items.' ), $param, number_format_i18n( $args['maxItems'] ) ) ); 1289 1300 } 1290 1301 }
Note: See TracChangeset
for help on using the changeset viewer.