API / Minn\Runtime / NavMenu

NavMenu final class

Minn\Runtime\NavMenu · public/minn/src/Minn/Runtime/NavMenu.php · 88 lines

wp_nav_menu()'s menu: the one the arguments name, its items marked for the page in view (MenuItemMarks), walked, wrapped in the container.

Constants and properties

privatestatic array $usedIds

Public

staticbuild(object $args): string|false|null#

The whole menu for wp_nav_menu(): resolve, fetch, decorate, walk, wrap, filter. Null when there is no menu (the caller's fallback runs); false when the items filtered away to nothing.

Internals 3

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatemenuForArgs(object $args): object|false#

The menu the args name: by menu, by assigned location, else the first menu that has items.

privatewrapId(object $menu, object $args): string#

The ul id: the caller's, else menu-{slug}, counted up when the same menu renders twice on a page.

privatecontainer(string $nav, object $args, string $slug): string#

The container wrap, when the args ask for one.