Make WordPress Core

Changeset 55632 for trunk


Ignore:
Timestamp:
04/07/2023 02:34:51 PM (15 months ago)
Author:
SergeyBiryukov
Message:

Comments: Add missing arguments for get_comment_time() in comment_time().

In a recent change, comment_time() was updated to accept a $comment_id parameter for consistency with comment_date(), following a similar change for get_comment_time().

However, the new parameter was not correctly passed to get_comment_time() inside the function. It should be passed as the fourth parameter after $format, $gmt and $translate, not the second.

This commit adds the missing arguments and a few unit tests to confirm the correct behavior.

Follow-up to [55284], [55287], [55308].

Props costdev, tmatsuur, ugyensupport, johnbillion.
Fixes #58064.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r55614 r55632  
    11101110 */
    11111111function comment_time( $format = '', $comment_id = 0 ) {
    1112     echo get_comment_time( $format, $comment_id );
     1112    echo get_comment_time( $format, false, true, $comment_id );
    11131113}
    11141114
Note: See TracChangeset for help on using the changeset viewer.