Filters the date a post was published.
Parameters
$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.
Source
return apply_filters( 'get_the_date', $the_date, $format, $post );
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
Example migrated from Codex:
Below is a basic example on how to use the
get_the_date
filter to modify date format for a post type called ‘product’: