WPDev.one
Core Function
View Source on Trac ↗

get_lastpostdate()

get_lastpostdate( mixed $timezone = 'server', mixed $post_type = 'any' )

Retrieves the most recent time that a post on the site was published.

Parameters 1 required

Name / Type Description
string

$timezone Optional. The timezone for the timestamp. Accepts 'server', 'blog', or 'gmt'. 'server' uses the server's internal timezone. 'blog' uses the `post_date` field, which proxies to the timezone set for the site. 'gmt' uses the `post_date_gmt` field. Default 'server'.

Required
$post_type
string

Optional. The post type to check. Default 'any'.

Return Value

(string)
The date of the last post, or false on failure.

Function Information

Since Version
0.71
Source File
wp-includes/post.php
Advertisement