wpcf7_is_date()CF7 1.0

Checks whether the given text is a valid date.

Хуки из функции

Возвращает

null. Ничего (null).

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

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

Код wpcf7_is_date() CF7 5.9.3

function wpcf7_is_date( $text ) {
	$result = preg_match(
		'/^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/',
		$text,
		$matches
	);

	if ( $result ) {
		$result = checkdate( $matches[2], $matches[3], $matches[1] );
	}

	return apply_filters( 'wpcf7_is_date', $result, $text );
}