No "awaiting moderation" message when anonymous comments are enabled (2 posts)

  1. chadrew
    Posted 3 years ago #

    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.

  2. Albinal
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic