acf/validate_rest_value/type=(type)
Filters whether a value passed via REST is valid.
Usage
add_filter( 'acf/validate_rest_value/type=(type)', 'wp_kama_acf_validate_rest_value_type_filter', 10, 3 );
/**
* Function for `acf/validate_rest_value/type=(type)` filter-hook.
*
* @param bool $valid True if the value is valid, false or WP_Error if not.
* @param mixed $value The value to check.
* @param array $field An array of information about the field.
*
* @return bool
*/
function wp_kama_acf_validate_rest_value_type_filter( $valid, $value, $field ){
// filter...
return $valid;
}
- $valid(true|false)
- True if the value is valid, false or WP_Error if not.
- $value(mixed)
- The value to check.
- $field(array)
- An array of information about the field.
Changelog
| Since 5.11 | Introduced. |
Where the hook is called
acf/validate_rest_value/type=(type)
acf/includes/rest-api/class-acf-rest-api.php 185
$valid = apply_filters( 'acf/validate_rest_value/type=' . $field['type'], true, $field_value, $field );