findByConfirmationSegment($confirmation_id); if (!$booking) { return false; } // Configure $wp_query + virtual WP_Post so FSE block themes don't fall back to 404.html. $this->setupPageEnvironment('singular', [ 'title' => __('Booking Confirmation', 'yatra'), 'object_id' => (int) ($booking->id ?? 0), 'post_type' => 'page', 'post_name' => $confirmation_id, ]); // Set up global booking object $this->setGlobal('yatra_booking', $booking); // Set up query vars for backward compatibility $this->setQueryVars([ 'yatra_booking_confirmation' => $confirmation_id, 'yatra_booking' => $booking, ]); return $this->selectTemplate('booking-confirmation', null, 'booking-confirmation'); } }