Make WordPress Core


Ignore:
Timestamp:
02/15/2026 11:17:55 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Docs: Add missing null to $post parameter types in various functions.

Props apermo.
Fixes #64645.

File:
1 edited

Legend:

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

    r61644 r61649  
    27172717 * @since 3.0.0
    27182718 *
    2719  * @param string      $format Optional. PHP date format. Defaults to the 'date_format' option.
    2720  * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.
     2719 * @param string           $format Optional. PHP date format. Defaults to the 'date_format' option.
     2720 * @param int|WP_Post|null $post   Optional. Post ID or WP_Post object. Default current post.
    27212721 * @return string|int|false Date the current post was written. False on failure.
    27222722 */
     
    27832783 * @since 4.6.0 Added the `$post` parameter.
    27842784 *
    2785  * @param string      $format Optional. PHP date format. Defaults to the 'date_format' option.
    2786  * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.
     2785 * @param string           $format Optional. PHP date format. Defaults to the 'date_format' option.
     2786 * @param int|WP_Post|null $post   Optional. Post ID or WP_Post object. Default current post.
    27872787 * @return string|int|false Date the current post was modified. False on failure.
    27882788 */
     
    28392839 * @since 1.5.0
    28402840 *
    2841  * @param string      $format Optional. Format to use for retrieving the time the post
    2842  *                            was written. Accepts 'G', 'U', or PHP date format.
    2843  *                            Defaults to the 'time_format' option.
    2844  * @param int|WP_Post $post   Post ID or post object. Default is global `$post` object.
     2841 * @param string           $format Optional. Format to use for retrieving the time the post
     2842 *                                 was written. Accepts 'G', 'U', or PHP date format.
     2843 *                                 Defaults to the 'time_format' option.
     2844 * @param int|WP_Post|null $post   Post ID or post object. Default is global `$post` object.
    28452845 * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
    28462846 *                          False on failure.
     
    28752875 * @since 2.0.0
    28762876 *
    2877  * @param string      $format    Optional. Format to use for retrieving the time the post
    2878  *                               was written. Accepts 'G', 'U', or PHP date format. Default 'U'.
    2879  * @param bool        $gmt       Optional. Whether to retrieve the GMT time. Default false.
    2880  * @param int|WP_Post $post      Post ID or post object. Default is global `$post` object.
    2881  * @param bool        $translate Whether to translate the time string. Default false.
     2877 * @param string           $format    Optional. Format to use for retrieving the time the post
     2878 *                                    was written. Accepts 'G', 'U', or PHP date format. Default 'U'.
     2879 * @param bool             $gmt       Optional. Whether to retrieve the GMT time. Default false.
     2880 * @param int|WP_Post|null $post      Post ID or post object. Default is global `$post` object.
     2881 * @param bool             $translate Whether to translate the time string. Default false.
    28822882 * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
    28832883 *                          False on failure.
     
    29392939 * @since 5.3.0
    29402940 *
    2941  * @param int|WP_Post $post   Optional. Post ID or post object. Default is global `$post` object.
    2942  * @param string      $field  Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
    2943  *                            Default 'date'.
    2944  * @param string      $source Optional. Local or UTC time to use from database. Accepts 'local' or 'gmt'.
    2945  *                            Default 'local'.
     2941 * @param int|WP_Post|null $post   Optional. Post ID or post object. Default is global `$post` object.
     2942 * @param string           $field  Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
     2943 *                                 Default 'date'.
     2944 * @param string           $source Optional. Local or UTC time to use from database. Accepts 'local' or 'gmt'.
     2945 *                                 Default 'local'.
    29462946 * @return DateTimeImmutable|false Time object on success, false on failure.
    29472947 */
     
    29842984 * @since 5.3.0
    29852985 *
    2986  * @param int|WP_Post $post  Optional. Post ID or post object. Default is global `$post` object.
    2987  * @param string      $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
    2988  *                           Default 'date'.
     2986 * @param int|WP_Post|null $post  Optional. Post ID or post object. Default is global `$post` object.
     2987 * @param string           $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
     2988 *                                Default 'date'.
    29892989 * @return int|false Unix timestamp on success, false on failure.
    29902990 */
     
    30273027 * @since 4.6.0 Added the `$post` parameter.
    30283028 *
    3029  * @param string      $format Optional. Format to use for retrieving the time the post
    3030  *                            was modified. Accepts 'G', 'U', or PHP date format.
    3031  *                            Defaults to the 'time_format' option.
    3032  * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.
     3029 * @param string           $format Optional. Format to use for retrieving the time the post
     3030 *                                 was modified. Accepts 'G', 'U', or PHP date format.
     3031 *                                 Defaults to the 'time_format' option.
     3032 * @param int|WP_Post|null $post   Optional. Post ID or WP_Post object. Default current post.
    30333033 * @return string|int|false Formatted date string or Unix timestamp. False on failure.
    30343034 */
     
    30643064 * @since 2.0.0
    30653065 *
    3066  * @param string      $format    Optional. Format to use for retrieving the time the post
    3067  *                               was modified. Accepts 'G', 'U', or PHP date format. Default 'U'.
    3068  * @param bool        $gmt       Optional. Whether to retrieve the GMT time. Default false.
    3069  * @param int|WP_Post $post      Post ID or post object. Default is global `$post` object.
    3070  * @param bool        $translate Whether to translate the time string. Default false.
     3066 * @param string           $format    Optional. Format to use for retrieving the time the post
     3067 *                                    was modified. Accepts 'G', 'U', or PHP date format. Default 'U'.
     3068 * @param bool             $gmt       Optional. Whether to retrieve the GMT time. Default false.
     3069 * @param int|WP_Post|null $post      Post ID or post object. Default is global `$post` object.
     3070 * @param bool             $translate Whether to translate the time string. Default false.
    30713071 * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
    30723072 *                          False on failure.
Note: See TracChangeset for help on using the changeset viewer.