Skip to documentation content

Developer Reference

Use feature and Language Navigation contracts

Query presentation capabilities and language switch URLs through provider-neutral contracts without exposing entitlements or vendor APIs.

Use hotel_booking_has_feature() or hotel_booking_features() for boolean presentation capability. The result exposes only stable capability names, surface associations and core/optional type; it never exposes a license key, expiry, entitlement provider or failure reason. Render an optional section only when both capability and content are available.

For languages, call hotel_booking()->languages() and consume LanguageNavigationInterface. Use current(), available(), url(), state(), provider() and snapshot(). Each item provides code, locale, label, native_label, direction, url, current and switchable.

Safety rules

  • Core owns provider detection, normalization, switch URLs, route locks and cache-safe state; the theme owns markup, placement, accessibility and display.
  • Do not call WPML or Polylang directly, set a vendor global language or add a cookie.
  • Respect single_language, unavailable, locked and provider_error states. Sensitive confirmation and payment routes stay locked without switch URLs.
  • Keep hb_language and provider-localized actions on virtual booking routes.

These contracts let one theme support Free-only, Pro-enriched and multilingual sites with the same defensive rendering path and predictable fallback behavior.

Next: integrate payment gateways.

Was this article helpful?

Your feedback helps us improve the documentation.