get_post_time filter-hookWP 2.6.0

Filters the localized time a post was written.

Usage

add_filter( 'get_post_time', 'wp_kama_get_post_time_filter', 10, 3 );

/**
 * Function for `get_post_time` filter-hook.
 * 
 * @param string|int $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 bool       $gmt    Whether to retrieve the GMT time.
 *
 * @return string|int
 */
function wp_kama_get_post_time_filter( $time, $format, $gmt ){

	// filter...
	return $time;
}
$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(true|false)
Whether to retrieve the GMT time.

Changelog

Since 2.6.0 Introduced.

Where the hook is called

get_post_time()
get_post_time
wp-includes/general-template.php 2764
return apply_filters( 'get_post_time', $time, $format, $gmt );

Where the hook is used in WordPress

Usage not found.