Notifications
Clear all

ADJUST COMMENT LAYOUT ACCORDING TO RANK

2 Posts
2 Users
0 Likes
1,254 Views
(@webminfo)
Eminent Member
Joined: 5 years ago
Posts: 21
Topic starter  

Hi

I've read the tutorial at here  https://mycred.me/tutorials/adjust-comment-layout-according-to-rank/#tutorial

There is a snippet code

add_filter( 'comment_class', 'insert_rank_into_comment_class', 10, 4 );
function insert_rank_into_comment_class( $classes, $class, $comment_id, $post_id )
{
	$comment = get_comment( $comment_id );
	if ( $comment->user_id == 0 ) return $classes;

	$classes[] = 'rank-' . mycred_get_users_rank( $comment->user_id, 'post_name' );

	return $classes;
}

But it does not add css class in return. Could you please check the code above and confirm it works with Wpdiscuz plugin?

Thanks


   
Quote
Arina
(@arina)
Support Team
Joined: 10 years ago
Posts: 101
 

Hi @webminfo,

Please note wpDiscuz doesn't have such a hook:

comment_class

you need to use this one instead of it:

wpdiscuz_comment_wrap_classes

   
ReplyQuote
Share:
Scroll to top