WordPress “comment_class” filter

Filters :

comment_class :

Calls when comments are displayed in a post, it is called for generating the css classes for the comment block.

You can add your css class with them to highlight a comment or do any customization you want.

How to use :

Register the filter :

add_filter('comment_class', "test_function", 1 );

Define The Function :

function test_function($classes)
{
     classes[] = "my-css-class";
     return $classes;
}