get_the_date
Filters the date of the post.
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
$formatis '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 2736
return apply_filters( 'get_the_date', $the_date, $format, $post );