From b6d780508bb78140c50bbada9207861f4b7b6a29 Mon Sep 17 00:00:00 2001 From: n0099 Date: Sat, 21 Aug 2021 10:49:09 +0800 Subject: [PATCH] fix: recent comments widget date display exception (#415) --- inc/theme-widgets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/theme-widgets.php b/inc/theme-widgets.php index ed34089..6a577a2 100644 --- a/inc/theme-widgets.php +++ b/inc/theme-widgets.php @@ -143,7 +143,7 @@ function string_cut($string, $sublen, $start = 0, $code = 'UTF-8') function latest_comments($list_number = 5, $cut_length = 50) { global $wpdb, $output; - $comments = $wpdb->get_results($wpdb->prepare("SELECT comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_content FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID WHERE comment_approved = '1' AND (comment_type = '' OR comment_type = 'comment') AND user_id != '1' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT %d", $list_number)); + $comments = $wpdb->get_results($wpdb->prepare("SELECT comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date, comment_content FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID WHERE comment_approved = '1' AND (comment_type = '' OR comment_type = 'comment') AND user_id != '1' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT %d", $list_number)); foreach ($comments as $comment) { $nickname = esc_attr($comment->comment_author) ?: __('匿名', 'kratos'); $output .= '