get_post_modified_time
云策文档标注
概述
get_post_modified_time 是一个 WordPress 过滤器,用于修改文章最后修改时间的本地化输出。它允许开发者自定义时间格式和时区设置。
关键要点
- 过滤器名称:get_post_modified_time
- 参数:$timestring(格式化的日期字符串或 Unix 时间戳)、$format(时间格式,如 'G'、'U' 或 PHP 日期格式)、$gmt(是否使用 GMT 时间)
- 返回值:应用过滤器后的时间值
- 相关函数:get_post_modified_time() 用于获取文章最后修改时间
- 引入版本:WordPress 2.8.0
原文内容
Filters the localized time a post was last modified.
Parameters
$timestring|int-
Formatted date string or Unix timestamp if
$formatis'U'or'G'. $formatstring-
Format to use for retrieving the time the post was modified.
Accepts'G','U', or PHP date format. Default'U'. $gmtbool-
Whether to retrieve the GMT time. Default false.
Source
return apply_filters( 'get_post_modified_time', $time, $format, $gmt );
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |