Contributor: Add function for removing a contributor from a pledge

This commit is contained in:
Corey McKrill 2019-10-25 12:25:12 -07:00
parent 701af36fa8
commit 49fd08e8bd
No known key found for this signature in database
GPG key ID: C2C0746F7BF17E38

View file

@ -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.
*