From 0a1310b60d78e3befa7361587999cc8b79a5ea2d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 28 Mar 2022 10:25:01 +0000 Subject: [PATCH] Docs: Correct the documented return types for date and time related functions and filters. See #54729 Built from https://develop.svn.wordpress.org/trunk@53000 git-svn-id: http://core.svn.wordpress.org/trunk@52589 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 18 +++++++++--------- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 92496ce92b..8b286ddb20 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -2555,7 +2555,7 @@ function the_date( $format = '', $before = '', $after = '', $echo = true ) { * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post. - * @return string|false Date the current post was written. False on failure. + * @return string|int|false Date the current post was written. False on failure. */ function get_the_date( $format = '', $post = null ) { $post = get_post( $post ); @@ -2573,9 +2573,9 @@ function get_the_date( $format = '', $post = null ) { * * @since 3.0.0 * - * @param string $the_date The formatted date. + * @param string|int $the_date Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * @param string $format PHP date format. - * @param int|WP_Post $post The post object or ID. + * @param WP_Post $post The post object. */ return apply_filters( 'get_the_date', $the_date, $format, $post ); } @@ -2699,10 +2699,10 @@ function get_the_time( $format = '', $post = null ) { * * @since 1.5.0 * - * @param string $the_time The formatted time. + * @param string|int $the_time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * @param string $format Format to use for retrieving the time the post * was written. Accepts 'G', 'U', or PHP date format. - * @param int|WP_Post $post WP_Post object or ID. + * @param WP_Post $post Post object. */ return apply_filters( 'get_the_time', $the_time, $format, $post ); } @@ -2756,10 +2756,10 @@ function get_post_time( $format = 'U', $gmt = false, $post = null, $translate = * * @since 2.6.0 * - * @param string $time The formatted time. - * @param string $format Format to use for retrieving the time the post was written. - * Accepts 'G', 'U', or PHP date format. Default 'U'. - * @param bool $gmt Whether to retrieve the GMT time. Default false. + * @param string|int $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. + * @param string $format Format to use for retrieving the time the post was written. + * Accepts 'G', 'U', or PHP date format. + * @param bool $gmt Whether to retrieve the GMT time. */ return apply_filters( 'get_post_time', $time, $format, $gmt ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index a4c8467460..96312b24d6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52999'; +$wp_version = '6.0-alpha-53000'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.