• Resolved elitaz

    (@elitaz)


    Hi lads. I hope everyone doing well.
    I am trying to make only post author to be able to Reply to the comments.
    Can someone assist me with that.
    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, elitaz, here is a code snippet that you can use to only allow the post author to reply to comments, essentially removing the link that is is called “Reply”:

    add_filter('comment_reply_link','hide_link_unless_author', 10, 4);
    function hide_link_unless_author( $link, $args, $comment, $post )
    {
    	if ( get_current_user_id() != $post->post_author )
    	{
    		return;
    	}
    	return $link;
    }

    You can insert this into your functions.php file or use a code snippet plugin such as Code Snippets.

    Here are images of it in action:

    Here is an image when the author is viewing the post –

    Here is an image when the general public is viewing the post –

    Thread Starter elitaz

    (@elitaz)

    Hi Ian. Thanks for reply. It works like a charm.
    Cheers mate!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Reply to comment’ is closed to new replies.