wp_transition_comment_status example

$post_id = $comment->comment_post_ID;
    if ( $post_id && 1 == $comment->comment_approved ) {
        wp_update_comment_count( $post_id );
    }

    clean_comment_cache( $comment->comment_ID );

    /** This action is documented in wp-includes/comment.php */
    do_action( 'wp_set_comment_status', $comment->comment_ID, 'delete' );

    wp_transition_comment_status( 'delete', $comment->comment_approved, $comment );

    return true;
}

/** * Moves a comment to the Trash * * If Trash is disabled, comment is permanently deleted. * * @since 2.9.0 * * @param int|WP_Comment $comment_id Comment ID or WP_Comment object. * @return bool True on success, false on failure. */
Home | Imprint | This part of the site doesn't use cookies.