admin-tabs.php
Shared tab-UI helpers for the plugin's tab-organised admin pages.
Table of Contents
Functions
- creationell_captcha_tabbed_page_hooks() : array<int, string>
- Records and reports the admin-page hook suffixes of the plugin's tab-organised pages.
- creationell_captcha_active_tab() : string
- Determines the active tab from the request, whitelisted against $tabs.
- creationell_captcha_render_nav_tabs() : void
- Renders the no-JavaScript fallback style and the nav-tab bar.
Functions
creationell_captcha_tabbed_page_hooks()
Records and reports the admin-page hook suffixes of the plugin's tab-organised pages.
creationell_captcha_tabbed_page_hooks([mixed $add = null ]) : array<int, string>
A submenu page's hook suffix derives from the sanitised parent menu title, not its slug, so it cannot be reliably hardcoded. Each tabbed page passes the value WordPress returns from add_menu_page()/add_submenu_page() here, and the admin asset loader matches the current screen against the recorded set.
Parameters
- $add : mixed = null
-
Hook suffix to record; ignored unless a non-empty string.
Return values
array<int, string> —All recorded hook suffixes.
creationell_captcha_active_tab()
Determines the active tab from the request, whitelisted against $tabs.
creationell_captcha_active_tab(array<string, string> $tabs) : string
Falls back to the first tab when no valid tab query parameter is present.
The value only selects which panel is shown and is strictly whitelisted
against the given registry, so no nonce check is required.
Parameters
- $tabs : array<string, string>
-
Tab registry (id => label).
Return values
string —Active tab id.
creationell_captcha_render_nav_tabs()
Renders the no-JavaScript fallback style and the nav-tab bar.
creationell_captcha_render_nav_tabs(array<string, string> $tabs, string $active_tab, string $base_url) : void
Without JavaScript the per-tab panels would each be hidden by admin.css; the
Parameters
- $tabs : array<string, string>
-
Tab registry (id => label).
- $active_tab : string
-
Active tab id.
- $base_url : string
-
Page URL the tab links point at.