Make WordPress Core

Ticket #52322: 52322.2.diff

File 52322.2.diff, 1.5 KB (added by travisaxton, 5 years ago)

Version 2.0

  • wp-includes/comment-template.php

    diff --git wp-includes/comment-template.php wp-includes/comment-template.php
    index e6b246c..5c6c7c3 100644
    function comment_text( $comment_ID = 0, $args = array() ) { 
    10321032 * Retrieves the comment time of the current comment.
    10331033 *
    10341034 * @since 1.5.0
     1035 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    10351036 *
    1036  * @param string $format    Optional. PHP date format. Defaults to the 'time_format' option.
    1037  * @param bool   $gmt       Optional. Whether to use the GMT date. Default false.
    1038  * @param bool   $translate Optional. Whether to translate the time (for use in feeds).
    1039  *                          Default true.
     1037 * @param string         $format     Optional. PHP date format. Defaults to the 'time_format' option.
     1038 * @param bool           $gmt        Optional. Whether to use the GMT date. Default false.
     1039 * @param bool           $translate  Optional. Whether to translate the time (for use in feeds).
     1040 *                                   Default true.
     1041 * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the date.
    10401042 * @return string The formatted time.
    10411043 */
    1042 function get_comment_time( $format = '', $gmt = false, $translate = true ) {
    1043         $comment = get_comment();
     1044function get_comment_time( $format = '', $gmt = false, $translate = true, $comment_ID = 0 ) {
     1045        $comment = get_comment( $comment_ID );
    10441046
    10451047        $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
    10461048