$body, 'headers' => array( 'Content-Type' => 'application/json', ), 'headers' => [ 'Content-Type' => 'application/json', 'Content-Length' => strlen($body), 'User-Agent' => 'WordPress/QuadLayers', // Set a custom User-Agent ], ) ); if (is_wp_error($response)) { return false; } $statusCode = wp_remote_retrieve_response_code($response); // Return true if the status code is 200 (OK) return $statusCode === 200; } }