wpcf7_is_date

The Contact Form 7 wpcf7 is date function.

Description

wpcf7_is_date( $date ); 

Parameters (1)

0. $date
The date.

Usage

  1. if ( !function_exists( 'wpcf7_is_date' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/formatting.php'; 
  3.  
  4. // The date. 
  5. $date = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpcf7_is_date($date); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/formatting.php  
  1. function wpcf7_is_date( $date ) { 
  2. $result = preg_match( '/^([0-9]{4, })-([0-9]{2})-([0-9]{2})$/', $date, $matches ); 
  3.  
  4. if ( $result ) { 
  5. $result = checkdate( $matches[2], $matches[3], $matches[1] ); 
  6.  
  7. return apply_filters( 'wpcf7_is_date', $result, $date );