acf_field_textarea::validate_value() public ACF 5.7.11
Validates a field's value.
{} Это метод класса: acf_field_textarea{}
Хуков нет.
Возвращает
(true/false/Строку).
Использование
$acf_field_textarea = new acf_field_textarea(); $acf_field_textarea->validate_value( $valid, $value, $field, $input );
- Whether((true/false/строка)) (обязательный)
- the value is vaid or not.
- $value(смешанный) (обязательный)
- The field value.
- $field(массив) (обязательный)
- The field array.
- $input(строка) (обязательный)
- The HTML input name.
Список изменений
С версии 5.7.11 | Введена. |
Код acf_field_textarea::validate_value() acf field textarea::validate value ACF 5.9.1
function validate_value( $valid, $value, $field, $input ){
// Check maxlength.
if( $field['maxlength'] && (acf_strlen($value) > $field['maxlength']) ) {
return sprintf( __('Value must not exceed %d characters', 'acf'), $field['maxlength'] );
}
// Return.
return $valid;
}