diff --git a/classes/class-pmpromc-mailchimp-api.php b/classes/class-pmpromc-mailchimp-api.php index 86537db..38e760d 100644 --- a/classes/class-pmpromc-mailchimp-api.php +++ b/classes/class-pmpromc-mailchimp-api.php @@ -171,6 +171,17 @@ public function update_audience_members( $audience = '', $updates = [] ) { 'members' => $updates, 'update_existing' => true, ); + /** + * Filter the body parameter sent to the "update audience members" endpoint. + * + * @since TBD + * + * @param object $data The data to send to the Mailchimp API. + * @param string $audience The audience ID being updated. + * + * @return object The data to send to the Mailchimp API. + */ + $data = apply_filters( 'pmpromc_update_audience_members_data', $data, $audience ); $url = self::$api_url . "/lists/{$audience}"; $args = array( 'method' => 'POST', // Allows us update a user ID