diff --git a/plugins/wporg-5ftf/includes/contributor.php b/plugins/wporg-5ftf/includes/contributor.php index 2bb5099..0d387ac 100644 --- a/plugins/wporg-5ftf/includes/contributor.php +++ b/plugins/wporg-5ftf/includes/contributor.php @@ -134,6 +134,20 @@ function create_new_contributor( $wporg_username, $pledge_id ) { return wp_insert_post( $args, true ); } +/** + * Remove a contributor post from a pledge. + * + * This wrapper function ensures we have a standardized way of removing a contributor that will still + * transition a post status (see PledgeMeta\update_confirmed_contributor_count). + * + * @param int $contributor_post_id + * + * @return false|WP_Post|null + */ +function remove_contributor( $contributor_post_id ) { + return wp_trash_post( $contributor_post_id ); +} + /** * Get the contributor posts associated with a particular pledge post. *