wpcf7_is_name() │ CF7 1.0

Checks whether a string is a valid NAME token.

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

Хуков нет.

Возвращает

bool. True if it is a valid name, false if not.

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

wpcf7_is_name( $text );
$text(обязательный)
.

Код wpcf7_is_name() CF7 6.1.7

function wpcf7_is_name( $text ) {
	return preg_match( '/^[A-Za-z][-A-Za-z0-9_:.]*$/', $text );
}