Notifications
Clear all
Topic starter
22/01/2019 5:38 pm
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
24/01/2019 12:23 pm
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