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.9.4

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