WPCF7_Validation::is_valid()publicCF7 1.0

Returns true if the target field is valid.

Метод класса: WPCF7_Validation{}

Хуков нет.

Возвращает

true|false. True if the target field has no error. If no target is specified, returns true if all fields are valid. Otherwise false.

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

$WPCF7_Validation = new WPCF7_Validation();
$WPCF7_Validation->is_valid( $name );
$name(строка|null)
If specified, this is the name of the target field.
По умолчанию: null

Код WPCF7_Validation::is_valid() CF7 5.6.4

public function is_valid( $name = null ) {
	if ( ! empty( $name ) ) {
		return ! isset( $this->invalid_fields[$name] );
	} else {
		return empty( $this->invalid_fields );
	}
}