Ready to get started?Download WordPress


Allow duplicate comment? (2 posts)

  1. Zambrano Sergio
    Posted 4 years ago #

    I need to add the condition "except if duplicate comment_text == 'no comments' " to the duplicate comment validation.

    I'm a copy-paste dev and I'm not sql-code diver yet. I can see the code below is in charge of that, but can't tell where.

    Can you help me up? (translating the sql would be a plus and would make you my god, hehe)

    	if ( $comment_author_email )
    		if ( defined('DOING_AJAX') )
    		/*wp_die( __('Duplicate comment detected; it looks as though you’ve already said that!') );*/
  2. strangerstudios
    Posted 3 years ago #


    You can use this code I just wrote as a starting point:

    My code at that link works by adding some random text to the end of a new comment so it doesn't look like a dupe. Then that text gets removed from the comment after posting.

    You can add a conditional to the first function to only add the random code when the comment body is "no comment".


    if($comment_data['comment_content'] == "no comment")
    $random = md5(time());
    return $comment_data;

    You need to use all the code from the link above, but add a conditional like this here. I hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Topic