'DELETE', 'timeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array("Content-type" => "application/json;charset=UTF-8", "Authorization" => "Basic " . $OneSignalWPSetting_rest_api_key) ) ); $result['type'] = "success"; } else { $result['type'] = "error"; } if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { $result = json_encode($result); echo $result; } else { header("Location: " . $_SERVER["HTTP_REFERER"]); } die(); }