Definition:
function wp_trash_comment($comment_id) {}
Moves a comment to the Trash
If trash is disabled, comment is permanently deleted.
Parameters
- int $comment_id: Comment ID.
Return values
returns:False on failure
Defined actions
- trash_comment
do_action('trash_comment', $comment_id);
- trashed_comment
do_action('trashed_comment', $comment_id);
Source code
function wp_trash_comment($comment_id) { if ( !EMPTY_TRASH_DAYS ) return wp_delete_comment($comment_id, true); if ( !$comment = get_comment($comment_id) ) return false; do_action('trash_comment', $comment_id); if ( wp_set_comment_status($comment_id, 'trash') ) { add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved); add_comment_meta($comment_id, '_wp_trash_meta_time', time() ); do_action('trashed_comment', $comment_id); return true; } return false; }
4183
No comments yet... Be the first to leave a reply!