handleScheduling($elementId, $post); } catch (\Wpae\Scheduling\Exception\SchedulingHttpException $e) { header('HTTP/1.1 503 Service unavailable', true, 503); echo json_encode(array('success' => false)); die; } $export = new PMXE_Export_Record(); $export->getById($elementId); $export->set(array('options' => array_merge($export->options, $post))); $export->save(); echo json_encode(array('success' => true)); die; } /** * @return bool */ function convertStringToBoolean($string) { return ($string == 'true' || $string == 1 || $string === true) ? true : false; }