From 4f5cb11d68705a1119728e607259374f20f764f1 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Wed, 29 Oct 2008 22:25:06 +0000 Subject: [PATCH] Make all comments classy. Fixes #8006 props filosofo. git-svn-id: https://develop.svn.wordpress.org/trunk@9405 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment-template.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 5421649d3a..66a9ada93e 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -226,6 +226,7 @@ function comment_author_url_link( $linktext = '', $before = '', $after = '' ) { * @param string|array $class One or more classes to add to the class list * @param int $comment_id An optional comment ID * @param int $post_id An optional post ID + * @param bool $echo Whether comment_class should echo or return */ function comment_class( $class = '', $comment_id = null, $post_id = null, $echo = true ) { // Separates classes with a single space, collates classes for comment DIV @@ -254,7 +255,7 @@ function get_comment_class( $class = '', $comment_id = null, $post_id = null ) { $classes = array(); // Get the comment type (comment, trackback), - $classes[] = $comment->comment_type; + $classes[] = ( empty( $comment->comment_type ) ) ? 'comment' : $comment->comment_type; // If the comment author has an id (registered), then print the log in name if ( $comment->user_id > 0 && $user = get_userdata($comment->user_id) ) {