API / Minn\Rest / MenuItemObject

MenuItemObject final readonly class

Minn\Rest\MenuItemObject · public/minn/src/Minn/Rest/MenuItemObject.php · 75 lines

The wp/v2/menu-items resource.

Constants and properties

privateTYPE_LABEL = array ( 'page' => 'Page', 'post' => 'Post', 'category' => 'Category', 'post_tag' => 'Tag', 'custom' => 'Custom Link', )
privatereadonly Minn\Rest\RestUrl $url

Promoted from the constructor.

privatereadonly Minn\Rest\Caller $caller

Promoted from the constructor.

Public

new__construct(Minn\Rest\RestUrl $url, Minn\Rest\Caller $caller)#
methodview(Minn\Content\MenuItem $item, Minn\Rest\Context $context): array#

The wp/v2 menu-item shape, through rest_prepare_nav_menu_item when a plugin hooks it.