Skip to content

Commit

Permalink
Using wp_json_encode()
Browse files Browse the repository at this point in the history
  • Loading branch information
dparker1005 committed Mar 19, 2024
1 parent 57abe2b commit 995ddb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/class-pmpromc-mailchimp-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function update_audience_members( $audience = '', $updates = [] ) {
'user-agent' => self::$user_agent,
'headers' => $this->url_args['headers'],
'timeout' => $this->url_args['timeout'],
'body' => json_encode($data),
'body' => wp_json_encode($data),
);

$resp = wp_remote_post($url, $args);
Expand Down Expand Up @@ -441,7 +441,7 @@ private function decode_response($response)
*/
private function encode($data)
{
if (false !== ($json = json_encode($data))) {
if (false !== ($json = wp_json_encode($data))) {
return $json;
}

Expand Down

0 comments on commit 995ddb0

Please sign in to comment.