wp_checkdate

Filters whether the given date is valid for the Gregorian calendar.

Description

apply_filters( 'wp_checkdate', (bool) $checkdate, (string) $source_date ); 

Parameters (2)

0. $checkdate (bool) => checkdate( $month, $day, $year )
Whether the given date is valid.
1. $source_date (string)
The source date.

Usage

To run the hook, copy the example below.
  1. $checkdate = apply_filters( 'wp_checkdate', $checkdate, $source_date ); 
  2.  
  3. if ( !empty( $checkdate ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_checkdate callback 
  2. function filter_wp_checkdate( $checkdate, $source_date ) { 
  3. // make filter magic happen here... 
  4. return $checkdate
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_checkdate', 'filter_wp_checkdate', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_checkdate', 'filter_wp_checkdate', 10, 2 ); 

Defined (1)

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

/wp-includes/functions.php  
  1. return apply_filters( 'wp_checkdate', checkdate( $month, $day, $year ), $source_date );