A WordPress-centric search engine for devs and theme authors



get_lastpostdate ›

Since0.71
Deprecatedn/a
get_lastpostdate ( $timezone = 'server' )
Parameters:
  • (string) $timezone The location to get the time. Accepts 'gmt', 'blog', or 'server'. Default 'server'.
    Required: No
    Default: 'server'
Returns:
  • (string) The date of the last post.
Defined at:
Codex:

Retrieve the date that the last post was published.

The server timezone is the default and is the difference between GMT and server time. The 'blog' value is the date when the last post was posted. The 'gmt' is when the last post was posted in GMT formatted date.



Source

function get_lastpostdate( $timezone = 'server' ) {
	/**
	 * Filter the date the last post was published.
	 *
	 * @since 2.3.0
	 *
	 * @param string $date     Date the last post was published. Likely values are 'gmt',
	 *                         'blog', or 'server'.
	 * @param string $timezone Location to use for getting the post published date.
	 */
	return apply_filters( 'get_lastpostdate', _get_last_post_time( $timezone, 'date' ), $timezone );
}