wpcf7_get_validation_error()CF7 1.0

Retrieves an HTML snippet of validation error on the given form control.

Хуков нет.

Возвращает

Строку. Validation error message in a form of HTML snippet.

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

wpcf7_get_validation_error( $name );
$name(строка) (обязательный)
Name of form control.

Код wpcf7_get_validation_error() CF7 5.6.4

function wpcf7_get_validation_error( $name ) {
	if ( ! $contact_form = wpcf7_get_current_contact_form() ) {
		return '';
	}

	return $contact_form->validation_error( $name );
}