function delete_seat($seat_id) { $result = false; global $wpdb; $check = $wpdb->get_row("select * from " . EVENTS_SEATING_CHART_EVENT_SEAT_TABLE . " where seat_id = {$seat_id} and attendee_id > 0"); if ($check === NULL) { $seat = $wpdb->get_row("select * from " . EVENTS_SEATING_CHART_SEAT_TABLE . " where id = " . $seat_id); $seating_chart_id = $seat->seating_chart_id; $wpdb->query("delete from " . EVENTS_SEATING_CHART_SEAT_TABLE . " where id = {$seat_id}"); $wpdb->query("delete from " . EVENTS_SEATING_CHART_EVENT_SEAT_TABLE . " where seat_id = {$seat_id} "); delete_transient(seating_chart::get_seat_list_transient($seating_chart_id, 'asc')); delete_transient(seating_chart::get_seat_list_transient($seating_chart_id, 'desc')); delete_transient(seating_chart::get_level_list_transient($seating_chart_id)); delete_transient(seating_chart::get_section_list_transient($seating_chart_id)); delete_transient(seating_chart::get_row_list_transient($seating_chart_id)); $result = true; } return $result; }