hi @ravi this is the NEW topic for that my problem i was on about.
…
…I was wondering about this my former post: https://buddydev.com/support/forums/topic/enable-threaded-nested-comments/
…
Been searching for a solution all over facebook and stackoverflow ..but no solution yet.You think maybe you could help me out with it..please?
I just want a specific user-role to be able to see this “REPLY” button: https://postimg.cc/crz2jTMj
Instead of everyone seeing it… ?? Please?
…
Maybe you could code the filter around this logic? :
https://developer.wordpress.org/reference/hooks/comment_reply_link/Hello Evillizard,
Please try the following code to hide the reply link on comments.
/** * Check weather current user can see reply button or not * * @param string $link Reply link. * * @return bool */ function buddydev_user_role_check_on_comment_reply_button( $link ) { if ( ! is_user_logged_in() || is_super_admin() ) { return $link; } $current_user = wp_get_current_user(); $allowed_roles = array( 'contributor', 'author' ); // Replace by your user role. $common_roles = array_intersect( $allowed_roles, $current_user->roles ); if ( empty( $common_roles ) ) { return false; } return $link; } add_filter( 'comment_reply_link', 'buddydev_user_role_check_on_comment_reply_button' );
Thanks
RaviOk, so with this code..only contributor and author role would be able to see the link right?
..
And if i wona change it so another role wld see..i would just add it to the “$allowed_roles” right??
Im asking instead of testing the code because: I don’t have electricity to test right now.. Cos they only sometimes give us electricity at mid-night
Ok ravi
Ild check it as soon as i have the time.
Thanks alot
Regards!
eviL-Lizard- This reply was modified 5 years, 7 months ago by evil lizard.
You must be logged in to reply to this topic.