function cruise_schedule_dates_request() { global $byt_cruises_post_type, $byt_theme_globals; if (isset($_REQUEST)) { $nonce = $_REQUEST['nonce']; if (wp_verify_nonce($nonce, 'byt-ajax-nonce')) { $cruise_id = intval(wp_kses($_REQUEST['cruiseId'], '')); $cabin_type_id = intval(wp_kses($_REQUEST['cabinTypeId'], '')); $month = intval(wp_kses($_REQUEST['month'], '')); $year = intval(wp_kses($_REQUEST['year'], '')); $day = intval(wp_kses($_REQUEST['day'], '')); $hour = 0; $minute = 0; $date_from = date('Y-m-d', strtotime("{$year}-{$month}-{$day} {$hour}:{$minute}")); if ($cruise_id > 0) { $cruise_obj = new byt_cruise(intval($cruise_id)); $schedule_entries = $byt_cruises_post_type->list_available_cruise_schedule_entries($cruise_id, $cabin_type_id, $date_from, $year, $month, $cruise_obj->get_type_is_repeated(), $cruise_obj->get_type_day_of_week_index()); echo json_encode($schedule_entries); } } } die; }