Black Friday
Skip to documentation content

Developer Reference

Use documented hooks and versioned payloads

A hook is a supported extension point only within its documented ownership, arguments and lifecycle. Finding an action or class in source does not make every internal callback a theme API.

A hook is a supported extension point only within its documented ownership, arguments and lifecycle. Finding an action or class in source does not make every internal callback a theme API.

Theme actions and context filters

Documented Theme Contract actions receive context and contractVersion. Surface filters receive extension metadata, canonical data and contractVersion; they extend presentation metadata rather than replacing canonical price, availability, validation or guest authorization.

add_action('kimorapro_hb_theme_before_book_now',
    static function (array $context, string $contractVersion): void {
        if (($context['surface'] ?? '') !== 'book_now'
            || version_compare($contractVersion, '1.0.0', '<')
            || version_compare($contractVersion, '2.0.0', '>=')) {
            return;
        }
        echo '<p class="example-booking-note">'
            . esc_html__('Review your stay details before submitting.', 'example-theme')
            . '</p>';
    }, 10, 2
);

This adds copy only. It must not initiate checkout, change a subtotal or construct a cancellation decision. Optional-section hooks may not fire when their capability/content is absent.

Do not rename unrelated protocols

Current Core theme hooks use kimorapro_hb_*. Pro’s payment extension action deliberately remains hb_payment_gateways_register; retained account shortcodes and transport fields have their own identities. A global prefix replacement can break a working extension.

Each contract has its own version probe. Same-major additive changes do not mean every component/template uses the global version number. Exact template versions still have their own catalog checks. Do not promise a universal deprecation period unless the owning contract actually specifies it.

Verify the consumer

Register at the documented lifecycle, use the declared accepted argument count and fail safely on missing/unsupported contracts. Escape theme-owned output. Test context immutability, unavailable optional output, throwing callbacks and native fallback separately.

Use the current symbol map and runtime catalog as reference evidence; historical manifests with pre-rename names or old release versions remain historical until their owning package reconciles them.

See templates and ownership.

Was this article helpful?

Your feedback helps us improve the documentation.