wp_spam_comment()
Marks a comment as Spam
Uses: wp_set_comment_status()
Hooks from the function
Return
true|false
. True on success, false on failure.
Usage
wp_spam_comment( $comment_id );
- $comment_id(int|WP_Comment) (required)
- Comment ID or WP_Comment object.
Examples
#1 Send comment with ID 3 to spam
$comm_id = 3; $spammed = wp_spam_comment( $comm_id ); if( $spammed ){ echo 'Comment sent to spam.' }
Changelog
Since 2.9.0 | Introduced. |