mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-05 10:25:45 +03:00
Log: Record event when contributor is removed from pledge
This commit is contained in:
parent
4476765503
commit
7da0387df2
2 changed files with 43 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue