Support » Fixing WordPress » No "awaiting moderation" message when anonymous comments are enabled

  • The “Your comment is awaiting moderation” message is created as follows:

    <?php if ( $comment->comment_approved == '0' ) : ?>
    <em>Your comment is awaiting moderation.</em>
    <?php endif; ?>

    If the “Comment author must fill out name and e-mail” option is checked in Discussion Settings, then the commenter will see his own comment, as well as “awaiting moderation” message after submitting.

    If said option is unchecked (thus allowing anonymous comments), and the visitor does not enter a name, he won’t see his comment, nor the message after submitting.

    What gives?

    I tried this with a clean install and Twenty Twelve theme just to be sure.

Viewing 1 replies (of 1 total)
  • I just had this very same problem. I couldn’t find a solution so I made my own. The moderation message will only show if the user enters a name. So, I added some JQuery to fill in the name with “Anonymous” if the author field is blank on submit.

    // Anonymous comments don’t give moderation message. So, if field is blank fill it in…
    if($(“#author”).val() == “”)

    It seems a bit daft, but it works.

Viewing 1 replies (of 1 total)
  • The topic ‘No "awaiting moderation" message when anonymous comments are enabled’ is closed to new replies.