NavMenuItems final class
Minn\Runtime\NavMenuItems · public/minn/src/Minn/Runtime/NavMenuItems.php · 154 lines
Classic menu items as the reference serves them to walkers and plugins (probe nav-menu-items). wp_setup_nav_menu_item dresses a nav_menu_item post with the fields walkers read: its _menu_item_* meta (ids as strings), kept when already set; then by its kind the label, address and title of what it points at (a post's title through the_title, every time, the item's own title winning when it has one; a post or term gone, or a post trashed, marks it _invalid; a post not published is labelled by its status); its title attribute and description through their filters. A post or term of another kind is dressed as a would-be item, as the admin's boxes use it: id 0, its own title, address and parent. wp_get_nav_menu_items reads a menu's items through get_posts, sets each up, drops the invalid ones outside the admin, and for ARRAY_A output sorts them by the output key and numbers that key from 1, all before its filter.
Public
Internals 7
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | menuItem(object $item): void# | A nav_menu_item post: its meta, what it points at, its attribute and description. |
| private | pointsAtPost(object $item): void# | An item for a post: the post type's name (its status's for a post not published), the post's address and filtered title. |
| private | pointsAtTerm(object $item): void# | An item for a term: the taxonomy's name, the term's address and name. |
| private | pointsAtArchive(object $item): void# | An item for a post type's archive: the archives label, the archive's address. |
| private | custom(object $item, string $url): void# | A custom link: its own title and stored address. |
| private | post(object $item): void# | A post of another kind, as a would-be item for it. |
| private | term(object $item): void# | A term, as a would-be item for it. |
Nothing matches.