M
M
mt. NATS2020-07-02 14:35:57
WordPress
mt. NATS, 2020-07-02 14:35:57

Restriction of comments, how to implement it easier?

Can anyone suggest the easiest way to restrict comments? Need:

  1. Each commenter can leave only one comment on the publication, one publication - one comment from each person
  2. Comments are hidden to everyone except the author of the post itself.
  3. Everyone except the author can only see their own comment


If you have a solution to any of these questions, I will be grateful!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2020-07-02
@Dimastik86

Enable required registration to leave a comment
The VI has wp_allow_comment . Explore the hooks inside.
In one of the hooks, you check if this author had a comment.
Further. There is a pre_get_comments hook . In it you can check the current user. If this is the author of the publication, do nothing. Otherwise, return only the comments of the current user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question