get_post_modified_time
Filters the localized time a post was last modified.
Использование
add_filter( 'get_post_modified_time', 'wp_kama_get_post_modified_time_filter', 10, 3 );
/**
* Function for `get_post_modified_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 modified. Accepts 'G', 'U', or PHP date format.
* @param bool $gmt Whether to retrieve the GMT time.
*
* @return string|int
*/
function wp_kama_get_post_modified_time_filter( $time, $format, $gmt ){
// filter...
return $time;
}
- $time(строка|int)
- Formatted date string or Unix timestamp if
$formatis 'U' or 'G'. - $format(строка)
- Format to use for retrieving the time the post was modified. Accepts 'G', 'U', or PHP date format.
По умолчанию: 'U' - $gmt(true|false)
- Whether to retrieve the GMT time.
По умолчанию: false
Список изменений
| С версии 2.8.0 | Введена. |
Где вызывается хук
get_post_modified_time
wp-includes/general-template.php 3119
return apply_filters( 'get_post_modified_time', $time, $format, $gmt );