rest_validate_enum
rest_validate_enum ( $value, $args, $param )
Parameters:- (mixed) value The value to validate.
- (array) args The schema array to use.
- (string) param The parameter name, used in error messages.
Returns:- (true|WP_Error) True if the "enum" contains the value or a WP_Error instance otherwise.
Defined at: - Introduced in WordPress: 5.7.0
- Deprecated in WordPress: —
Description
Validates that the given value is a member of the JSON Schema "enum".