Make WordPress Core

Changeset 53000


Ignore:
Timestamp:
03/28/2022 10:23:03 AM (3 years ago)
Author:
johnbillion
Message:

Docs: Correct the documented return types for date and time related functions and filters.

See #54729

File:
1 edited

Legend:

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

    r52406 r53000  
    25562556 * @param string      $format Optional. PHP date format. Defaults to the 'date_format' option.
    25572557 * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.
    2558  * @return string|false Date the current post was written. False on failure.
     2558 * @return string|int|false Date the current post was written. False on failure.
    25592559 */
    25602560function get_the_date( $format = '', $post = null ) {
     
    25742574     * @since 3.0.0
    25752575     *
    2576      * @param string      $the_date The formatted date.
     2576     * @param string|int  $the_date Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
    25772577     * @param string      $format   PHP date format.
    2578      * @param int|WP_Post $post     The post object or ID.
     2578     * @param WP_Post     $post     The post object.
    25792579     */
    25802580    return apply_filters( 'get_the_date', $the_date, $format, $post );
     
    27002700     * @since 1.5.0
    27012701     *
    2702      * @param string      $the_time The formatted time.
     2702     * @param string|int  $the_time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
    27032703     * @param string      $format   Format to use for retrieving the time the post
    27042704     *                              was written. Accepts 'G', 'U', or PHP date format.
    2705      * @param int|WP_Post $post     WP_Post object or ID.
     2705     * @param WP_Post     $post     Post object.
    27062706     */
    27072707    return apply_filters( 'get_the_time', $the_time, $format, $post );
     
    27572757     * @since 2.6.0
    27582758     *
    2759      * @param string $time   The formatted time.
    2760      * @param string $format Format to use for retrieving the time the post was written.
    2761      *                       Accepts 'G', 'U', or PHP date format. Default 'U'.
    2762      * @param bool   $gmt    Whether to retrieve the GMT time. Default false.
     2759     * @param string|int $time   Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
     2760     * @param string     $format Format to use for retrieving the time the post was written.
     2761     *                           Accepts 'G', 'U', or PHP date format.
     2762     * @param bool       $gmt    Whether to retrieve the GMT time.
    27632763     */
    27642764    return apply_filters( 'get_post_time', $time, $format, $gmt );
Note: See TracChangeset for help on using the changeset viewer.