From 7c0d982c8e7a661479132a5c127346d096fc407e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 7 Feb 2023 18:26:18 +0000 Subject: [PATCH] Comments: Allow to pass `$comment_ID` parameter to `comment_time()`. This brings consistency with: * `get_comment_time()` * `get_comment_date()` * `comment_date()` Includes: * Correcting the `@since` tag for `get_comment_time()`. * Synchronizing parameter description between `get_comment_date()` and `get_comment_time()`. Follow-up to [55284]. See #52322. Built from https://develop.svn.wordpress.org/trunk@55287 git-svn-id: http://core.svn.wordpress.org/trunk@54820 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 17 ++++++++++------- wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 1494be8b2a..ba6851e554 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -547,7 +547,7 @@ function get_comment_class( $css_class = '', $comment_id = null, $post = null ) * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. - * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the date. + * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the date. * Default current comment. * @return string The comment's date. */ @@ -1031,14 +1031,14 @@ function comment_text( $comment_ID = 0, $args = array() ) { * Retrieves the comment time of the current comment. * * @since 1.5.0 - * @since 6.2.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 6.2.0 Added the `$comment_ID` parameter. * * @param string $format Optional. PHP date format. Defaults to the 'time_format' option. * @param bool $gmt Optional. Whether to use the GMT date. Default false. * @param bool $translate Optional. Whether to translate the time (for use in feeds). * Default true. - * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the date. - * Default is 0, or the global comment. + * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the time. + * Default current comment. * @return string The formatted time. */ function get_comment_time( $format = '', $gmt = false, $translate = true, $comment_ID = 0 ) { @@ -1072,11 +1072,14 @@ function get_comment_time( $format = '', $gmt = false, $translate = true, $comme * Displays the comment time of the current comment. * * @since 0.71 + * @since 6.2.0 Added the `$comment_ID` parameter. * - * @param string $format Optional. PHP time format. Defaults to the 'time_format' option. + * @param string $format Optional. PHP time format. Defaults to the 'time_format' option. + * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the time. + * Default current comment. */ -function comment_time( $format = '' ) { - echo get_comment_time( $format ); +function comment_time( $format = '', $comment_ID = 0 ) { + echo get_comment_time( $format, $comment_ID ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 4b32c34412..c8e1282915 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55286'; +$wp_version = '6.2-alpha-55287'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.