WPDev.one
Core Class

WP_REST_Menu_Items_Controller

class WP_REST_Menu_Items_Controller // Constructor: function Object() { [native code] }

Core class to access nav items via the REST API.

Methods 15 methods

Method / Return Description
get_nav_menu_item()
(object

Gets the nav menu item, if the ID is valid.

Parameters: $id: mixed
get_items_permissions_check()
(true

Checks if a given request has access to read menu items.

Parameters: $request: mixed
get_item_permissions_check()
(bool

Checks if a given request has access to read a menu item if they have access to edit them.

Parameters: $request: mixed
check_has_read_only_access()
(true

Checks whether the current user has read permission for the endpoint.

Parameters: $request: mixed
create_item()
(WP_REST_Response

Creates a single nav menu item.

Parameters: $request: mixed
update_item()
(WP_REST_Response

Updates a single nav menu item.

Parameters: $request: mixed
delete_item()
(WP_REST_Response

Deletes a single nav menu item.

Parameters: $request: mixed
prepare_item_for_database()
(object

Prepares a single nav menu item for create or update.

Parameters: $request: mixed
prepare_item_for_response()
WP_REST_Response

Prepares a single nav menu item output for response.

Parameters: $item: mixed, $request: mixed
prepare_links()
array

Prepares links for the request.

Parameters: $post: mixed
get_schema_links()
array

Retrieves Link Description Objects that should be added to the Schema for the nav menu items collection.

get_item_schema()
array

Retrieves the nav menu item's schema, conforming to JSON Schema.

get_collection_params()
array

Retrieves the query params for the nav menu items collection.

prepare_items_query()
array

Determines the allowed query_vars for a get_items() response and prepares

Parameters: $prepared_args: mixed, $request: mixed
get_menu_id()
int

Gets the id of the menu that the given menu item belongs to.

Parameters: $menu_item_id: mixed

Class Information

Since Version
5.9.0
Source File
wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php
Advertisement