seat_type( $post_infos ); } else { $this->ticket_type( $post_infos ); } ?>
__( 'Invalid security token or Insufficient permissions.', 'abp-event-ticket' ), 'type' => 'warn' ], 403 ); } $post_val = fn( $key, $default = '' ) => isset( $_POST[ $key ] ) ? sanitize_text_field( wp_unslash( $_POST[ $key ] ) ) : $default; $post_int = fn( $key, $default = 0 ) => isset( $_POST[ $key ] ) ? absint( $_POST[ $key ] ) : $default; $post_id = $post_int( 'post_id' ); $seat_type = $post_val( 'type' ); $post_infos = ABPET_Function::get_all_meta( $post_id ); $post_infos['display_ticket_type'] = $post_val( 'display_ticket_type' ); ob_start(); if ( $seat_type == 'sp' ) { $this->seat_type( $post_infos ); } else { $this->ticket_type( $post_infos ); } $html = ob_get_clean(); wp_send_json_success( [ 'html' => $html, 'msg' => __( 'Ticket Type Switched Successfully...!', 'abp-event-ticket' ), 'type' => 'success' ] ); } public function seat_type( $post_infos ): void { $sp_infos = $post_infos['sp_infos'] ?? []; $display_ticket_type = $post_infos['display_ticket_type'] ?? 'on'; $display_ticket_type = ABPET_Function::on_off( 'ticket_type' ) ? $display_ticket_type : 'off'; $sp_data = ABPET_Query::get_sp(); $post_id = $post_infos['post_id'] ?? ''; $ticket_infos = $post_infos['ticket_infos'] ?? []; ?>
sp_item( $sp_data, $display_ticket_type, $ticket_info ); } } else { $this->sp_item( $sp_data, $display_ticket_type ); } ?>
*
$ticket_info ) { $this->sp_ticket_item( $ticket_info, $key ); } } else { $this->sp_ticket_item( [], 'ticket' ); } ?>
*
sp_item( $sp_data, $display_ticket_type ); ?>
ticket_item( $ticket_infos[ $key ], $key ); } else { foreach ( $ticket_infos as $key => $ticket_info ) { $this->ticket_item( $ticket_info, $key ); } } } else { $this->ticket_item(); } ?>
* * *
ticket_item(); ?>