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);
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);