Support » Fixing WordPress » Disable the ability to comment for post author
2 years, 5 months ago
Hi, I need to disable the ability to comment for the post author in his posts but not in the others.
Is it possibile? How can I do?
I don’t know if there’s a plug-in for this usage, but it is possible…
You need check the author of comment and compare it with the id of article, if same, the comment should be deleted on the fly.
Something looklike that:
$user = get_comment_author( get_comment( comment_ID() ) );
if ($user == get_the_author_meta('ID') )
wp_die('You can NOT comment in your own article!');}
It’s not a true code, you need some coding in a custom plugin.
If I don’t find a plugin, where I put this code?