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 (".").

Хуков нет.

Возвращает

true|false. True if it is a valid name, false if not.

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

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

Код wpcf7_is_name() CF7 5.6.2

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