get_post_time WordPress Filter Hook
The get_post_time Wordpress hook allows you to change the default time format for your posts. By default, posts are displayed in the WordPress time format, which is the time format set in your WordPress settings. However, if you want to change the time format for your posts, you can use the get_post_time hook.
apply_filters( 'get_post_time', string|int $time , string $format , bool $gmt ) #
Filters the localized time a post was written.
Parameters
- $time
(string|int)Formatted date string or Unix timestamp if
$format
is 'U' or 'G'.- $format
(string)Format to use for retrieving the time the post was written. Accepts 'G', 'U', or PHP date format.
- $gmt
(bool)Whether to retrieve the GMT time.
Source
Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |