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:

Description

Validates that the given value is a member of the JSON Schema "enum".

Related Functions

rest_validate_request_arg, validate_email, rest_validate_value_from_schema, validate_file, wp_validate_boolean

Top Google Results

User discussions

wpseek mobile