Definition:
function wp_spam_comment($comment_id) {}
Marks a comment as Spam
Parameters
- int $comment_id: Comment ID.
Return values
returns:False on failure
Defined actions
- spam_comment
do_action('spam_comment', $comment_id);
- spammed_comment
do_action('spammed_comment', $comment_id);
Source code
function wp_spam_comment($comment_id) { if ( !$comment = get_comment($comment_id) ) return false; do_action('spam_comment', $comment_id); if ( wp_set_comment_status($comment_id, 'spam') ) { add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved); do_action('spammed_comment', $comment_id); return true; } return false; }
4133
No comments yet... Be the first to leave a reply!