[label, capability, route]] * gatecraft_template_dirs string[] folders searched for templates, first match wins * gatecraft_setting_defaults array extra settings [key => default] * gatecraft_setting_rules array validation rules for a settings tab, second argument is the tab * gatecraft_setting_tabs array settings tabs [key => label] * gatecraft_email_templates array extra email templates * gatecraft_alert_types array extra staff alert types * gatecraft_event_tabs array event screen tabs [key => [label, path suffix]] * gatecraft_category_needs_approval bool, category row * gatecraft_discount_choice array chosen discount, see discount_choose() * gatecraft_checkout_answers array validated checkout answers, see create_order() * gatecraft_export_formats string[] export formats besides csv * gatecraft_send_table bool return true after sending a table in your own format * gatecraft_worker_jobs array results of background jobs, add yours * * Actions * gatecraft_slot_{name} output inside a screen, see slot() * gatecraft_event_saved event id, old row or null * gatecraft_category_saved category id * gatecraft_discount_saved discount id * gatecraft_event_tab_{tab} event id: render a custom event tab * gatecraft_order_paid order id: a booking was confirmed (paid, free or added by staff) */ /** True when an add-on provides this feature (for example "approvals"). Used to show or hide related screens. */ function feature(string $name): bool { return in_array($name, (array)apply_filters('gatecraft_features', []), true); } /** A named place in a template where add-ons print their own (escaped) markup. */ function slot(string $name, array $ctx = []): void { do_action('gatecraft_slot_' . $name, $ctx); } /** True when something is attached to a slot, so a template can skip an empty wrapper. */ function slot_used(string $name): bool { return has_action('gatecraft_slot_' . $name) !== false; } function template_dirs(): array { return (array)apply_filters('gatecraft_template_dirs', [GATECRAFT_DIR . 'templates/']); } function setting_defaults(): array { static $d = null; return $d ??= (array)apply_filters('gatecraft_setting_defaults', SETTING_DEFAULTS); } function email_templates(): array { static $t = null; return $t ??= (array)apply_filters('gatecraft_email_templates', EMAIL_TEMPLATES); } function alert_types(): array { static $t = null; return $t ??= (array)apply_filters('gatecraft_alert_types', ALERT_TYPES); } function admin_pages(): array { static $p = null; return $p ??= (array)apply_filters('gatecraft_admin_pages', GATECRAFT_ADMIN_PAGES); } function setting_tabs(): array { return (array)apply_filters('gatecraft_setting_tabs', SETTING_TABS); } /** Shown on Settings > About this plugin. */ const COPYRIGHT_LINE = 'Copyright © 2026 Gatecraft Japan. Released under the GNU General Public License, version 2 or later.'; /** Which build is running: free alone, free with the Pro add-on,. */ function edition_label(): string { if (defined('GATECRAFT_PRO_VERSION')) return 'Free, with the Gatecraft Pro add-on WP.' . GATECRAFT_PRO_VERSION; return 'Free'; }