mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-03 01:31:17 +03:00
Contributor: Add function for removing a contributor from a pledge
This commit is contained in:
parent
701af36fa8
commit
49fd08e8bd
|
@ -134,6 +134,20 @@ function create_new_contributor( $wporg_username, $pledge_id ) {
|
||||||
return wp_insert_post( $args, true );
|
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.
|
* Get the contributor posts associated with a particular pledge post.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue