Contributors: Reset profile hours when pledge deactivated.

See https://github.com/WordPress/five-for-the-future/issues/169
This commit is contained in:
Ian Dunn 2022-04-28 15:05:44 -07:00
parent 834c62c0d0
commit c6d7bbb7c1
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB
6 changed files with 338 additions and 4 deletions

View file

@ -387,6 +387,10 @@ function deactivate( $pledge_id, $notify = false, $reason = '' ) {
do_action( FiveForTheFuture\PREFIX . '_deactivated_pledge', $pledge_id, $notify, $reason, $result );
if ( ! is_wp_error( $result ) ) {
Contributor\remove_pledge_contributors( $pledge_id );
}
return $result;
}