wp_checkdate
Filters whether the given date is valid for the Gregorian calendar.
Description
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.
- $checkdate = apply_filters( 'wp_checkdate', $checkdate, $source_date );
- if ( !empty( $checkdate ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_checkdate callback
- function filter_wp_checkdate( $checkdate, $source_date ) {
- // make filter magic happen here...
- return $checkdate;
- };
- // add the filter
- add_filter( 'wp_checkdate', 'filter_wp_checkdate', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'wp_checkdate', 'filter_wp_checkdate', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/functions.php
- return apply_filters( 'wp_checkdate', checkdate( $month, $day, $year ), $source_date );