get_lastpostdate()
get_lastpostdate( string $timezone = ‘server’, string $post_type = ‘any’ )
检索网站上发布文章的最新时间。
Retrieves the most recent time that a post on the site was published.
说明(Description)
服务器时区是默认值,是GMT和服务器时间之间的差异。“blog”值是最后一篇文章发表的日期。“gmt”是以gmt格式的日期发布最后一篇文章的时间。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$timezone | (string) | 可选 | 时间戳的时区。接受“服务器”、“博客”或“gmt”服务器“使用服务器的内部时区。”blog使用post_date字段,该字段代理站点的时区集gmt’使用post_date_gmt字段。 |
$post_type | (string) | 可选 | 要检查的邮件类型。 |
返回(Return)
(string)最后一次投递的日期,失败时为false。
源码(Source)
get_lastpostdate() 函数的代码位于 wp-includes/post.php.
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.4.0 | wp-includes/post.php:6429 | 1 function | 3 |
get_lastpostdate() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_lastpostdate/