wpcf7_is_name()
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() wpcf7 is name CF7 5.7.5.1
function wpcf7_is_name( $text ) { return preg_match( '/^[A-Za-z][-A-Za-z0-9_:.]*$/', $text ); }