From 995ddb09a556ae1f749b487e29c40f69dcab22a3 Mon Sep 17 00:00:00 2001 From: David Parker Date: Tue, 19 Mar 2024 11:59:50 -0400 Subject: [PATCH] Using wp_json_encode() --- classes/class-pmpromc-mailchimp-api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/class-pmpromc-mailchimp-api.php b/classes/class-pmpromc-mailchimp-api.php index ea47224..7204521 100644 --- a/classes/class-pmpromc-mailchimp-api.php +++ b/classes/class-pmpromc-mailchimp-api.php @@ -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); @@ -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; }