Log: Record event when contributor is removed from pledge

This commit is contained in:
Corey McKrill 2019-10-28 12:53:37 -07:00
parent 4476765503
commit 7da0387df2
No known key found for this signature in database
GPG key ID: C2C0746F7BF17E38
2 changed files with 43 additions and 1 deletions

View file

@ -170,7 +170,19 @@ function add_pledge_contributors( $pledge_id, $contributors ) {
* @return false|WP_Post|null
*/
function remove_contributor( $contributor_post_id ) {
return wp_trash_post( $contributor_post_id );
$pledge_id = get_post( $contributor_post_id )->post_parent;
$result = wp_trash_post( $contributor_post_id );
/**
* Action: Fires when a contributor is removed from a pledge.
*
* @param int $pledge_id
* @param int $contributor_post_id
* @param WP_Post|false|null $result
*/
do_action( FiveForTheFuture\PREFIX . '_remove_contributor', $pledge_id, $contributor_post_id, $result );
return $result;
}
/**