AI Assistant
Notifications
Clear all

ADJUST COMMENT LAYOUT ACCORDING TO RANK

2 Posts
2 Users
0 Reactions
2,374 Views
(@webminfo)
Eminent Member
Joined: 7 years ago
Posts: 21
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
  [#3428]

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
Rina
 Rina
(@arina)
Support Team Registered
Joined: 12 years ago
Posts: 101
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

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