acf/validate_value/type=(type) filter-hookACF 5.0.0

Filters whether the value is valid.

Usage

add_filter( 'acf/validate_value/type=(type)', 'wp_kama_acf_validate_value_type_filter', 10, 4 );

/**
 * Function for `acf/validate_value/type=(type)` filter-hook.
 * 
 * @param bool   $valid The valid status. Return a string to display a custom error message.
 * @param mixed  $value The value.
 * @param array  $field The field array.
 * @param string $input The input element's name attribute.
 *
 * @return bool
 */
function wp_kama_acf_validate_value_type_filter( $valid, $value, $field, $input ){
	// filter...
	return $valid;
}
$valid(true|false)
The valid status. Return a string to display a custom error message.
$value(mixed)
The value.
$field(array)
The field array.
$input(string)
The input element's name attribute.

Changelog

Since 5.0.0 Introduced.

Where the hook is called

acf_validate_value()
acf/validate_value/type=(type)
acf/includes/validation.php 355
$valid = apply_filters( "acf/validate_value/type={$field['type']}", $valid, $value, $field, $input );

Where the hook is used in Advanced Custom Fields PRO

Usage not found.