Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter for body parameter data #137

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions classes/class-pmpromc-mailchimp-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down