Docs: Clarify that get_lastpostdate() and get_lastpostmodified() can return false on failure.

The both use `_get_last_post_time()` internally.

Props Rarst.
See #48957.
Built from https://develop.svn.wordpress.org/trunk@46973


git-svn-id: http://core.svn.wordpress.org/trunk@46773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-12-17 20:26:01 +00:00
parent bbd898b1dd
commit 8eb278d19a
2 changed files with 11 additions and 10 deletions

View File

@ -6392,7 +6392,7 @@ function get_posts_by_author_sql( $post_type, $full = true, $post_author = null,
* 'gmt' uses the `post_date_gmt` field.
* Default 'server'.
* @param string $post_type Optional. The post type to check. Default 'any'.
* @return string The date of the last post.
* @return string The date of the last post, or false on failure.
*/
function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) {
/**
@ -6400,9 +6400,9 @@ function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) {
*
* @since 2.3.0
*
* @param string $date Date the last post was published.
* @param string $timezone Location to use for getting the post published date.
* See get_lastpostdate() for accepted `$timezone` values.
* @param string|false $date Date the last post was published. False on failure.
* @param string $timezone Location to use for getting the post published date.
* See get_lastpostdate() for accepted `$timezone` values.
*/
return apply_filters( 'get_lastpostdate', _get_last_post_time( $timezone, 'date', $post_type ), $timezone );
}
@ -6421,7 +6421,7 @@ function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) {
* for information on accepted values.
* Default 'server'.
* @param string $post_type Optional. The post type to check. Default 'any'.
* @return string The timestamp in 'Y-m-d H:i:s' format.
* @return string The timestamp in 'Y-m-d H:i:s' format, or false on failure.
*/
function get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) {
/**
@ -6452,9 +6452,10 @@ function get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) {
*
* @since 2.3.0
*
* @param string $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format.
* @param string $timezone Location to use for getting the post modified date.
* See get_lastpostdate() for accepted `$timezone` values.
* @param string|false $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format.
* False on failure.
* @param string $timezone Location to use for getting the post modified date.
* See get_lastpostdate() for accepted `$timezone` values.
*/
return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
}
@ -6472,7 +6473,7 @@ function get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) {
* for information on accepted values.
* @param string $field Post field to check. Accepts 'date' or 'modified'.
* @param string $post_type Optional. The post type to check. Default 'any'.
* @return string|false The timestamp in 'Y-m-d H:i:s' format, or false on error.
* @return string|false The timestamp in 'Y-m-d H:i:s' format, or false on failure.
*/
function _get_last_post_time( $timezone, $field, $post_type = 'any' ) {
global $wpdb;

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.4-alpha-46972';
$wp_version = '5.4-alpha-46973';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.