How to hide "comment_form();" for Author role in wordpress? What i need to add in comments.php?
You can hook to the comments_open
filter.
add_filter('comments_open', function($open, $post_id){
if(in_array( 'author', (array) wp_get_current_user()->roles){
return false;
}
return $open;
}, 10, 2);