get_the_date
Filters the date a post was published.
Usage
add_filter( 'get_the_date', 'wp_kama_get_the_date_filter', 10, 3 ); /** * Function for `get_the_date` filter-hook. * * @param string|int $the_date Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * @param string $format PHP date format. * @param WP_Post $post The post object. * * @return string|int */ function wp_kama_get_the_date_filter( $the_date, $format, $post ){ // filter... return $the_date; }
- $the_date(string|int)
- Formatted date string or Unix timestamp if $format is 'U' or 'G'.
- $format(string)
- PHP date format.
- $post(WP_Post)
- The post object.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
get_the_date
wp-includes/general-template.php 2604
return apply_filters( 'get_the_date', $the_date, $format, $post );