WPDev.one
Core Class

WP_REST_Menus_Controller

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

Core class used to managed menu terms associated via the REST API.

Methods 15 methods

Method / Return Description
get_items_permissions_check()
(bool

Checks if a request has access to read menus.

Parameters: $request: mixed
get_item_permissions_check()
(true

Checks if a request has access to read or edit the specified menu.

Parameters: $request: mixed
get_term()
(WP_Term

Gets the term, if the ID is valid.

Parameters: $id: mixed
check_has_read_only_access()
(true

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

Parameters: $request: mixed
prepare_item_for_response()
WP_REST_Response

Prepares a single term output for response.

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

Prepares links for the request.

Parameters: $term: mixed
prepare_item_for_database()
object

Prepares a single term for create or update.

Parameters: $request: mixed
create_item()
(WP_REST_Response

Creates a single term in a taxonomy.

Parameters: $request: mixed
update_item()
(WP_REST_Response

Updates a single term from a taxonomy.

Parameters: $request: mixed
delete_item()
(WP_REST_Response

Deletes a single term from a taxonomy.

Parameters: $request: mixed
get_menu_auto_add()
bool

Returns the value of a menu's auto_add setting.

Parameters: $menu_id: mixed
handle_auto_add()
bool

Updates the menu's auto add from a REST request.

Parameters: $menu_id: mixed, $request: mixed
get_menu_locations()
string[]

Returns the names of the locations assigned to the menu.

Parameters: $menu_id: mixed
handle_locations()
(true

Updates the menu's locations from a REST request.

Parameters: $menu_id: mixed, $request: mixed
get_item_schema()
array

Retrieves the term's schema, conforming to JSON Schema.

Class Information

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