$value) { $menu[$key] = $value; if ('orders' === $key) { $menu[$slug] = ABPTB_Function::label() . ' ' . __('Bookings', 'abp-transport-booking'); } } if ('dashboard' === $slug || !array_key_exists($slug, $menu)) { $menu[$slug] = ABPTB_Function::label() . ' ' . __('Bookings', 'abp-transport-booking'); } return $menu; } public function maybe_flush_rules(): void { if (!get_option('abptb_my_account_flushed')) { $this->register_endpoint(); flush_rewrite_rules(false); update_option('abptb_my_account_flushed', 1); } } public function render_bookings(): void { $user_id = get_current_user_id(); ?>

' . esc_html__('Please login to see your bookings.', 'abp-transport-booking') . '

'; return; } $limit = absint(ABPTB_Function::get_option('abptb_per_page_item', 20)); if ($limit < 1) { $limit = 20; } $page = isset($_GET['abptb_page']) ? absint($_GET['abptb_page']) : 1; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ($page < 1) { $page = 1; } $offset = ($page - 1) * $limit; $filters = array( 'user_id' => $user_id, 'status' => 'all', 'order_by' => 'created_at', 'order_dir' => 'DESC', 'cache' => false, ); $total = ABPTB_Query::get_booking_query($filters, 0, 0, true); $bookings = ABPTB_Query::get_booking_query($filters, $limit, $offset); if (!empty($bookings) && is_array($bookings)) { foreach ($bookings as $booking_item) { $this->booking_card($booking_item); } $this->pagination($total, $limit, $page); } else { echo '

' . esc_html__('You have no transport bookings yet.', 'abp-transport-booking') . '

'; } ?>
$post_id)); ?>

# -

: 0 ? wp_kses_post(wc_price($total)) : esc_html__('FREE', 'abp-transport-booking'); ?>