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);
Related Posts:
- How do we remove the H3 tag for the reply-title I.D
- Success message in comment form
- Using filter to add additional fields to comment_form()
- How to add a div on comment fields / edited
- How to modify comments form using comment_form()?
- Comment form problem with comment_author_url and HTML5 input placeholders
- stackexchange-like submit comment window
- WordPress custom form action url
- After Submitting Comment Form Shows an Empy Page in WordPress
- Spammers attacking my WordPress Site – Removing URL field from core? [closed]
- Disable only the comment form/box itself?
- Copy and Paste Password for Comments
- How t Remove Labels from comment Box
- comment form code redirect to wp_comments_post.php with blank page
- Need to output comment_form() function inside a foreach loop
- How add custom text under comment form
- Delete comments function
- Image Upload Form is Disabling Comment Addition
- Comment submission & navigation redirects to default language
- Reply to a specific comment?
- How to hide the login / profile urls on top of comment box for a post
- Comments screen in backend, how to disable email address of commenter for non admins
- How can I limit the number of comments per registered user per day?
- Parent comment’s author name
- get_comments_number of depth-1 (Level 1) (1 post)
- How can I control the comment counts filtering my CPT replies?
- How to auto-approve internal pingbacks?
- Can I store my custom comment_type into wp_comments table?
- Number of External Links in Comments – Moderation Option
- What is comment_karma?
- How to override function twentyten_comment
- Disqus over the default commenting engine, what are some pros and cons?
- How To Remove The “Click here to cancel reply” Link From The WordPress Comment Form
- Plugin from WordPress.com for comment notification…available? [closed]
- Enable Recent Comments widget to display comments on attachment posts
- Change allowed HTML tags for comments
- How can I highlight admin comments?
- On WordPress 4.4, how to get the post id using the comment_post hook
- Block comments from search engine indexing
- Create a “Reject” action for comments?
- Add action on delete comments?
- Exclude child comments in get_comments() or WP_Comment_Query?
- Changing “submitted on date” of comments
- Can’t seem to get this CSS to work…any ideas why? [closed]
- Change order of comment fields
- How to add a strip of visual editor on top of comments textarea
- Threaded comments not working
- Customizing comments pagination for bootstrap
- comment_post action hook running on page load instead of after a comment is posted
- woocommerce allow users to select or use avatar
- How to sort posts by the average of comment meta values
- Error While Sending Comment
- Retrieve data from the database to table such as comments in the admin control panel
- Problem with Comment link in Blog [closed]
- Commenting in user profile page?
- Can i Use own Facebook App ID with this Social Comment Plugin? [closed]
- How do i hide all comments from logged out users
- Only allow the post author and admin to comment on a post
- Grant a person permission to moderate all comments on a blog without giving them the ability to edit other peoples post
- How come pending comments are appearing in admin?
- Generate Sub-Comments with WP-CLI [closed]
- comment_date() & comment_time() not working from functions.php
- Repositioning ‘Reply’ Link in Comments
- Add an attachment feature to comments
- Counting Comments as Singular and Plural in comments.php Template
- Comments change the template name
- I can’t post comment via REST API
- WordPress scruity issue – Totally disable all comments by CSS — secure enough?
- Sending comment notifications to different recipients depending on taxonomy terms
- wp_new_comment requires author url and author email
- Replying to comments
- Where are comments coded when using custom theme?
- unsetting required fields in the comment reply form
- What is the point of get_comment_count() if you cannot limit by a comment type?
- Wrong IP address in comment section
- Problem code and show comments
- Highlight comments made by registered users of the site
- It doesn’t matter if I have more than one comment. get_comments_number still equal to one?
- Simple spam check for valid domain in commenter’s email address
- Allowing WordPress.org/com accounts on a self-hosted install
- Post comments don’t show
- Get all comments associated with a specific page ID (comment_post_ID)
- Update post “A” on comment submition on post “B”
- How do I add custom field to Admin comment form and display
- I would like to count number of comments after 5 days ago
- Comments counter only for Authors Posts
- Necessary to have a comments.php if there are no comments?
- Inserting comments via a procedure
- transition_comment_status gets called when untrashing comments
- spacebar is not working in input and textarea
- wp-editor-area textarea disapear on cancel-comment-reply-link click
- Conditionally process comments while ignoring replies
- Required Field for Comment parent only?
- Passing user meta through comment form
- How do I separate author avatars and comments in 3.4.2?
- How do I convert users who put an email and username for a comment into registered users? [duplicate]
- What filter or action to replace comments or add new comment system
- How to stop a specific person to comment on my blog? [closed]
- How do you fetch the authors email or IP from /comments? (REST API)
- WordPress Editor widgets “comments” and “post comments form” getting disappeared with elementor [closed]