The question here is if someone could help me to make the comment "Your comment is awaiting moderation" work correctly for custom page. It works ok for standard Wordpress page but not for my own page.

I use native wp function get_comments() and wp_list_comments() to get and display comments. If I submit new comment that awaits moderation the comment and the message Your comment is awaiting moderation is accessible to anyone.

I always thought that the awaiting comments is visible only to the user that submitted the comment. If it's not the case what is purpose of the message if anyone is able to see the comment? The one purpose I can think of is that it is a kind of notice that this comment will be moderated in the future and could be deleted.

If really everyone can see the comment that it would make sense if the message reads This comment is awaiting moderation. Is there any way how to change the text of the message from a plugin?

UPDATE

ok, so it is my code. If I display the page using standard wp way it works ok. If I use my code it doesn't work (meaning everyone can see the comment with awaiting message. Would someone know what I need to add to my code to make it work? I use just two above functions. The code is something like that

$comments =     get_comments(array(
    'post_id' => $post_id,
    'status' => 'approve' 
));
    wp_list_comments(array(
//              'page' => 1,
        'per_page' => 10,
        'avatar_size'   => 16,
    ), $comments);

As far as I remember awaiting moderation message should be only visible to author of the comment. If it is displaying otherwise it might be faulty caching implementation or other code interfering.

The customization of it depends on where it is coming from - it can be WP core, core theme or third party theme using same string.

  • ok, so it is my code. If I display the page using standard wp way it works ok. If I use my code it doesn't work (meaning everyone can see the comment with awaiting message. Would you know what I need to add to my code to make it work? I use just two above functions. – Radek Oct 16 '13 at 9:09
  • My question is how make it so the text "Your comment is awaiting moderation" with my php code. It is obvious that I am missing something. but what? – Radek Dec 15 '13 at 9:50

protected by Community Apr 22 '16 at 10:41

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.