Function Reference/get lastpostdate

来自WordPress中文文档
跳转至: 导航搜索

Description

Retrieve the date the 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.

Usage

%%%<?php get_lastpostdate( $timezone ) ?>%%%

Parameters

tt$timezone/tt
(string) (optional) The location to get the time. Can be 'gmt', 'blog', or 'server'.
Default: 'server'noinclude

div class=template-description style=padding: 0 1.5em; border: 1px solid #eeeeee; background-color: #f9f9f9

Notes

This template is for standardizing how parameters look in the Function Reference and in Template Tags. Here is an example of this template being called: prenowiki检查到模板循环:模板:Parameter/nowiki/pre 检查到模板循环:模板:Parameter

The usage of this template is below: prenowiki检查到模板循环:模板:Parameter/nowiki/pre Let's take a closer look at the parameters..

name
The name of the parameter.
datatype
The datatype that should be given for this parameter when called.
  • string
  • integer
  • boolean
  • mixed
description
A short description of the parameter.
importance
Set this parameter to optional if the parameter is optional. Otherwise, do not declare this parameter—it defaults to required.
  • required
  • optional
default
If this parameter is optional, ttdefault/tt is the value that will be used if the parameter is not declared.

wordpress.org.cn /div /noinclude

Return Values

(string) 
The date of the last post.

Examples

Notes

  • Uses: apply_filters() Calls 'get_lastpostdate' filter
  • Uses global: (mixed) $cache_lastpostdate Stores the date the last post.
  • Uses global: (object) $wpdb
  • Uses global: (integer) $blog_id The Blog ID.

Change Log

Since: 0.71

Source File

get_lastpostdate() is located in wp-includes/post.php.

Related

includeonlydiv style=clear:both; background-color:#F7F7F7; border:1px solid #CCCCCC; color:#000000; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;See also index of Function Reference and index of Template Tags./div/includeonlynoinclude

Description

This Template is used by Codex:Template Messages.

Usage

pre 检查到模板循环:模板:Message /pre

Result

检查到模板循环:模板:Message

/noinclude