0

Is it possible to put a button in the comments(front-end) that would show/hide comments that are in spam status in the current post?

1 Answer 1

0

Yes; you can use get_comments() function to query comments and specify spam as the status. Placing the button will depend on your theme, but the below is how to get the comments marked as spam (tested):

get_comments( array(
    'post_id' => $post_id,
    'status'  => 'spam',
) );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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