API / Minn\Runtime / NavigationFallback

NavigationFallback final class

Minn\Runtime\NavigationFallback · public/minn/src/Minn/Runtime/NavigationFallback.php · 104 lines

The navigation menu a navigation block falls back to (WP_Navigation_Fallback, and the block_core_navigation_* helpers the reference keeps as deprecated): the newest published navigation menu, else one made from the site's classic menu, else a default listing the pages (probes navigation-fallback, nav-pomo-rest-doubts).

Public

staticfallback(): mixed#

The navigation menu to fall back to: the newest published one; else, unless wp_navigation_should_create_fallback says not, one made from the classic menu or, without one, the default, then the newest again.

staticclassicMenu(): mixed#

The classic menu a navigation falls back to: the one in the primary location, else the one slugged primary, else the newest; null without menus.

staticclassicMenuBlocks(object $menu, ?callable $parse = NULL): string#

A classic menu's items as serialized navigation blocks, parsed by the callable given (else here).

staticmenuItemBlocks(mixed $items, mixed $byParent, ?callable $parse = NULL): array#

Menu items as navigation blocks: a link each, a submenu for an item with children (its inner blocks serialized as its content), the children parsed by the callable given (else here).

@return list<array<string, mixed>>
staticnewest(): mixed#

The newest published navigation menu, through the query's filters, or null.

staticfromClassicMenu(): mixed#

The classic menu made a published navigation menu: the insert's answer, or null without a classic menu or with an empty one.

staticcreateDefault(): mixed#

A published navigation menu titled Navigation, listing the site's pages while the page list block is registered.