acf/validate_value/type=(type) хук-фильтрACF 5.0.0

Filters whether the value is valid.

Использование

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(разное)
The value.
$field(массив)
The field array.
$input(строка)
The input element's name attribute.

Список изменений

С версии 5.0.0 Введена.

Где вызывается хук

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

Где используется хук в Advanced Custom Fields PRO

Использование не найдено.