get_the_modified_time()
get_the_modified_time( string $format = ”, int|WP_Post …
get_the_modified_time( string $format = ”, int|WP_Post $post = null )
检索上次修改帖子的时间。
Retrieve the time at which the post was last modified.
目录锚点:#参数#返回#源码
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $format | (string) | 可选 | 用于检索邮件修改时间的格式。“G”、“U”或PHP日期格式默认为time_format选项中指定的值。 |
| $post | (int | WP_Post) | 可选 | Post ID或WP_Post对象。默认当前职位。 |
返回(Return)
(string|false)格式化的日期string或Unix时间戳。失败时为False。
源码(Source)
/**
* Retrieve the time at which the post was last modified.
*
* @since 2.0.0
*
* @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option.
* @return string
*/
function get_the_modified_time($d = '') {
if ( '' == $d )
$the_time = get_post_modified_time(get_option('time_format'), null, null, true);
else
$the_time = get_post_modified_time($d, null, null, true);
/**
* Filter the localized time a post was last modified.
*
* @since 2.0.0
*
* @param string $the_time The formatted time.
* @param string $d Format to use for retrieving the time the post was
* written. Accepts 'G', 'U', or php date format. Defaults
* to value specified in 'time_format' option.
*/
return apply_filters( 'get_the_modified_time', $the_time, $d );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 4.6.0 | wp-includes/general-template.php:2714 | 1 function | 5 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!