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( $string );
- $string (обязательный)
- -
Заметки
Код wpcf7_is_name() wpcf7 is name CF7 5.4
function wpcf7_is_name( $string ) {
return preg_match( '/^[A-Za-z][-A-Za-z0-9_:.]*$/', $string );
}