API / Minn\Admin / AdminMenu

AdminMenu final class

Minn\Admin\AdminMenu · public/minn/src/Minn/Admin/AdminMenu.php · 75 lines

The admin menu's arithmetic, as plugins' menu calls see it on the reference (probe admin-doubts): where a top-level entry is filed, the hook a plugin page runs on, the file a plugin page's address is built on, and the parent of the page being shown. The menu arrays themselves stay the globals plugins read; this class only works things out from them.

Public

statichookName(string $type, string $page): string#

The hook a plugin page runs on: its type, "_page_", and the page with every ".php" taken out.

staticpositionKey(array $menu, mixed $position, string $slug, string $title): string|int|null#

The key a top-level entry is filed under: null (appended) without a numeric position; the position itself when it is free; a taken one moved on by a fraction drawn from the slug and title, written as text.

$menuarray<int|string, mixed>
staticpageBase(string $slug, array $parents): ?string#

The file a plugin page's address is built on: admin.php for a top-level page, one under another plugin page or under none; the parent's own file otherwise; null for a page never registered.

$parentsarray<string, string|false>the page => parent map ($_parent_pages)
staticparentOf(array $menu, array $submenu, string $pagenow, string $pluginPage, string $typenow, array $realParents): string#

The parent file of the page being shown: for a plugin page, the top-level entry that is the page or the submenu holding it; otherwise the submenu holding the current file (with "?post_type=" and the type when there is one); each mapped through the real parents, '' when nothing holds it.

$menuarray<int|string, mixed>
$submenuarray<string, mixed>
$realParentsarray<string, string>