Make WordPress Core

Changeset 46973


Ignore:
Timestamp:
12/17/2019 08:24:46 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r46968 r46973  
    63936393 *                          Default 'server'.
    63946394 * @param string $post_type Optional. The post type to check. Default 'any'.
    6395  * @return string The date of the last post.
     6395 * @return string The date of the last post, or false on failure.
    63966396 */
    63976397function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) {
     
    64016401     * @since 2.3.0
    64026402     *
    6403      * @param string $date     Date the last post was published.
    6404      * @param string $timezone Location to use for getting the post published date.
    6405      *                         See get_lastpostdate() for accepted `$timezone` values.
     6403     * @param string|false $date     Date the last post was published. False on failure.
     6404     * @param string       $timezone Location to use for getting the post published date.
     6405     *                               See get_lastpostdate() for accepted `$timezone` values.
    64066406     */
    64076407    return apply_filters( 'get_lastpostdate', _get_last_post_time( $timezone, 'date', $post_type ), $timezone );
     
    64226422 *                          Default 'server'.
    64236423 * @param string $post_type Optional. The post type to check. Default 'any'.
    6424  * @return string The timestamp in 'Y-m-d H:i:s' format.
     6424 * @return string The timestamp in 'Y-m-d H:i:s' format, or false on failure.
    64256425 */
    64266426function get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) {
     
    64536453     * @since 2.3.0
    64546454     *
    6455      * @param string $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format.
    6456      * @param string $timezone         Location to use for getting the post modified date.
    6457      *                                 See get_lastpostdate() for accepted `$timezone` values.
     6455     * @param string|false $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format.
     6456     *                                       False on failure.
     6457     * @param string       $timezone         Location to use for getting the post modified date.
     6458     *                                       See get_lastpostdate() for accepted `$timezone` values.
    64586459     */
    64596460    return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
     
    64736474 * @param string $field     Post field to check. Accepts 'date' or 'modified'.
    64746475 * @param string $post_type Optional. The post type to check. Default 'any'.
    6475  * @return string|false The timestamp in 'Y-m-d H:i:s' format, or false on error.
     6476 * @return string|false The timestamp in 'Y-m-d H:i:s' format, or false on failure.
    64766477 */
    64776478function _get_last_post_time( $timezone, $field, $post_type = 'any' ) {
Note: See TracChangeset for help on using the changeset viewer.