get_the_time
Filters the time of the post.
Usage
add_filter( 'get_the_time', 'wp_kama_get_the_time_filter', 10, 3 );
/**
* Function for `get_the_time` filter-hook.
*
* @param string|int $the_time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
* @param string $format Format to use for retrieving the time the post was written. Accepts 'G', 'U', or PHP date format.
* @param WP_Post $post Post object.
*
* @return string|int
*/
function wp_kama_get_the_time_filter( $the_time, $format, $post ){
// filter...
return $the_time;
}
- $the_time(string|int)
- Formatted date string or Unix timestamp if
$formatis 'U' or 'G'. - $format(string)
- Format to use for retrieving the time the post was written. Accepts 'G', 'U', or PHP date format.
- $post(WP_Post)
- Post object.
Changelog
| Since 1.5.0 | Introduced. |
Where the hook is called
get_the_time
wp-includes/general-template.php 2862
return apply_filters( 'get_the_time', $the_time, $format, $post );