WordPress.org

Ready to get started?Download WordPress

Forums

Easy one for the pros (2.7.1) (5 posts)

  1. jeffb0
    Member
    Posted 5 years ago #

    Have an easy one (hopefully).

    When a non-logged-in visitor leaves a comment and comment moderation is enabled, they are shown a "Your comment is awaiting moderation..." preview box of their comment.

    The theme check for this is $comment->comment_approved returning true.

    Well all of a sudden my visitors (checked it myself) are not shown this message, however I still see $comment->comment_approved is set properly in the loop.

    Seems like the comments loop just suddenly stopped looking for posts that were not yet approved.

    Any troubleshooting ideas?

  2. nathanrice
    Member
    Posted 5 years ago #

    Instead of checking for a return of true, do this:

    <?php if ($comment->comment_approved == '0') : ?>
    <p class="alert"><?php _e('Your comment is awaiting moderation.') ?></p>
    <?php endif; ?>
  3. jeffb0
    Member
    Posted 5 years ago #

    Hey Nathan, it's already set up that way... 0 = FALSE, 1 = TRUE.

    Could it be a cookie issue?

    As I said, it seems like the pending comment isn't even hitting the comments loop. I'd really appreciate any input from a Dev or whatnot on what I should be looking for.

  4. jeffb0
    Member
    Posted 5 years ago #

    Been a few days, was hoping someone would come to my rescue. :)

    I've tried everything except for reinstalling WordPress, including reverting to the default 2.7.1 theme.

    Again, my $comment_approved check looks like this, yet the user is not shown their post-preview, almost as if the yet-to-be-approved comment isn't hitting the comments loop:

    if($comment->comment_approved == '0') :

    Any devs that could shoot me something to check out (is it a cookie thing?), would be much appreciated.

  5. jeffb0
    Member
    Posted 5 years ago #

    Read: my test comments have been going to the akismet spam queue. Unfreakinbelieveable.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.