1

How can I enable or disable comments on front end by post author?

Back end is closed for my authors and some authors sometimes don't want to enable comments. Maybe we can add a field (check box) that will allow post authors to enable or disable new comments.

May be we can develop like this (with the following checkbox options):

  1. Hide all past comments
  2. Show old but close new comments.

closed as off-topic by Michael, Jacob Peattie, Krzysiek Dróżdż, Christine Cooper, Howdy_McGee May 26 '18 at 18:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • Can you please clarify what you mean by "Back end is closed for my authors"? How do the authors submit posts then? – Fayaz May 20 '18 at 12:10
  • You can completely disable comment using php code in functions.php dfactory.eu/wp-how-to-turn-off-disable-comments – Lasantha May 20 '18 at 13:30
  • Thanks your reply and answers @nazaria but i know that solution at admin panel. I mean that my author (members) can add/edit/publish post on frontend with a form. So they never access admin panel to edit post at admin panel. So, Post author can enable or disable comments on frontend. Such as i'm editing now this comment, if i publihed this post, i sould close to comments to others... Sorry bad english i hope u understand. Thanks Regards – ineedyou May 20 '18 at 14:49
3

Actually it's there within WordPress by Default.

If your WordPress editor is not showing it, then from the top left corner, click the Screen Options drop down menu. It'll show some check boxes. Among those, there is one called Discussion. If you check that, then WordPress will show the option Allow Comments after the editor within Discussion Meta Box.

This is an author level option, so authors should be able to access this. If an author unchecks Allow Comments from the beginning, then no comment will be shown for that post. On the other hand, if an author unchecks this after some comments are received, then the older comments will be shown, but there will be no option to post new comments.

Not the answer you're looking for? Browse other questions tagged or ask your own question.