*/ class Ad_Back_Post { public static function execute($url, $fields, $header = array()) { $args = array( 'headers' => array( 'Content-Type' => 'application/json' ), 'body' => is_array($fields) ? json_encode($fields) : $fields ); $response = wp_remote_post($url, $args ); return wp_remote_retrieve_body($response); } }