Black Friday
Skip to documentation content

Multilingual Sites

Consume the public language-navigation API

Current Core exposes language navigation through kimorapro_hb()->languages(). The small public facade returns normalized language data and safe switch URLs; the theme owns placement, labels, markup and accessibility.

Current Core exposes language navigation through kimorapro_hb()->languages(). The small public facade returns normalized language data and safe switch URLs; the theme owns placement, labels, markup and accessibility.

if (function_exists('kimorapro_hb')
    && function_exists('kimorapro_hb_language_navigation_contract_version')
    && version_compare(kimorapro_hb_language_navigation_contract_version(), '1.0.0', '>=')
    && version_compare(kimorapro_hb_language_navigation_contract_version(), '2.0.0', '<')) {
    $navigation = kimorapro_hb()->languages();
    if ($navigation->state() === 'ready') {
        foreach ($navigation->available() as $language) {
            if (!$language['switchable'] || $language['current']) {
                continue;
            }
            echo '<a href="' . esc_url($language['url']) . '">'
                . esc_html($language['native_label']) . '</a>';
        }
    }
}

The consumer must also keep the supported contract major; a future major requires explicit review. The example only renders prepared destinations and performs no provider/global language switch or persistence.

Read the normalized result

current() returns an item or null; available() returns the ordered list; url(string $language) accepts a supported code/locale and can return an empty string. state(), provider() and snapshot() provide request-local presentation context.

Items contain code, locale, label, native_label, direction, url, current and switchable. Respect both availability and switchability instead of inventing a fallback URL. Typical states include ready, single_language, unavailable, locked and provider_error.

Sensitive booking/payment/confirmation/nonce/token/signature requests suppress switch URLs. The contract does not authorize guest booking access or rewrite the saved booking locale. Only HTTP(S), credential-free destinations are accepted.

Historical manifests may still name the pre-rename facade; current examples use the actual bootstrap export above. Do not globally rename retained Pro shortcodes/hooks or infer another public method such as kimorapro_hb()->features(); this facade currently exposes languages() only.

See developer feature/navigation reference.

Was this article helpful?

Your feedback helps us improve the documentation.