AdminMenu
in package
Registers WebVIEP admin menu, dashboard, and submenu highlighting.
Table of Contents
Constants
- PARENT_SLUG = 'webviep_dashboard'
Methods
- addMenus() : void
- Register main menu and submenus for plugin screens.
- forceMenuHighlight() : void
- Force WordPress to mark the correct submenu as current when navigating custom screens.
- hideDashboardSubmenu() : void
- Hide the duplicated dashboard submenu; the top-level menu remains accessible.
- highlightParentForTopics() : string|false
- Keep WebVIEP menu highlighted on all plugin-related screens.
- highlightSubmenuForTopics() : string|false
- Highlight the matching submenu entry for plugin-related screens.
- register() : void
- Hook menus and highlighting filters.
- renderDashboard() : void
- Render dashboard landing page.
- collectAccessibleSubmenus() : array<int, array<string, string>>
- Collect WebVIEP submenus that the current user can access.
- iconForSlug() : string
- Map submenu slugs to dashicons for nicer tiles.
- submenuHighlightMap() : array<string, string>
- Map admin pages to the submenu slug that should be highlighted.
Constants
PARENT_SLUG
private
mixed
PARENT_SLUG
= 'webviep_dashboard'
Methods
addMenus()
Register main menu and submenus for plugin screens.
public
static addMenus() : void
forceMenuHighlight()
Force WordPress to mark the correct submenu as current when navigating custom screens.
public
static forceMenuHighlight(WP_Screen $screen) : void
Parameters
- $screen : WP_Screen
hideDashboardSubmenu()
Hide the duplicated dashboard submenu; the top-level menu remains accessible.
public
static hideDashboardSubmenu() : void
highlightParentForTopics()
Keep WebVIEP menu highlighted on all plugin-related screens.
public
static highlightParentForTopics(string|false $parentFile) : string|false
Parameters
- $parentFile : string|false
Return values
string|falsehighlightSubmenuForTopics()
Highlight the matching submenu entry for plugin-related screens.
public
static highlightSubmenuForTopics(string|false $submenuFile) : string|false
Parameters
- $submenuFile : string|false
Return values
string|falseregister()
Hook menus and highlighting filters.
public
static register() : void
renderDashboard()
Render dashboard landing page.
public
static renderDashboard() : void
collectAccessibleSubmenus()
Collect WebVIEP submenus that the current user can access.
private
static collectAccessibleSubmenus() : array<int, array<string, string>>
Return values
array<int, array<string, string>>iconForSlug()
Map submenu slugs to dashicons for nicer tiles.
private
static iconForSlug(string $slug) : string
Parameters
- $slug : string
Return values
stringsubmenuHighlightMap()
Map admin pages to the submenu slug that should be highlighted.
private
static submenuHighlightMap() : array<string, string>