Log: Record when contributors are added to a pledge

This also updates the function that creates new contributor posts. It
replaces `create_new_contributor` with `add_pledge_contributors`. This
way we can capture a batch of contributor additions all in one event by
collecting all the `wp_insert_post` results in an array and including
it as an action parameter.
This commit is contained in:
Corey McKrill 2019-10-28 12:26:18 -07:00
parent a41ecd7665
commit 461278f525
No known key found for this signature in database
GPG key ID: C2C0746F7BF17E38
3 changed files with 55 additions and 15 deletions

View file

@ -90,9 +90,7 @@ function process_form_new() {
return $new_pledge_id;
}
foreach ( $contributors as $wporg_username ) {
Contributor\create_new_contributor( $wporg_username, $new_pledge_id );
}
Contributor\add_pledge_contributors( $new_pledge_id, $contributors );
// Attach logo to the pledge.
wp_update_post( array(