[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/rest-api/endpoints/ -> class-wp-rest-menu-items-controller.php (summary)

REST API: WP_REST_Menu_Items_Controller class

File Size: 1021 lines (32 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_REST_Menu_Items_Controller:: (15 methods):
  get_nav_menu_item()
  get_items_permissions_check()
  get_item_permissions_check()
  check_has_read_only_access()
  create_item()
  update_item()
  delete_item()
  prepare_item_for_database()
  prepare_item_for_response()
  prepare_links()
  get_schema_links()
  get_item_schema()
  get_collection_params()
  prepare_items_query()
  get_menu_id()


Class: WP_REST_Menu_Items_Controller  - X-Ref

Core class to access nav items via the REST API.

get_nav_menu_item( $id )   X-Ref
Get the nav menu item, if the ID is valid.

return: object|WP_Error Post object if ID is valid, WP_Error otherwise.
param: int $id Supplied ID.
since: 5.9.0

get_items_permissions_check( $request )   X-Ref
Checks if a given request has access to read menu items.

return: true|WP_Error True if the request has read access, WP_Error object otherwise.
param: WP_REST_Request $request Full details about the request.
since: 5.9.0

get_item_permissions_check( $request )   X-Ref
Checks if a given request has access to read a menu item if they have access to edit them.

return: bool|WP_Error True if the request has read access for the item, WP_Error object otherwise.
param: WP_REST_Request $request Full details about the request.
since: 5.9.0

check_has_read_only_access( $request )   X-Ref
Checks whether the current user has read permission for the endpoint.

This allows for any user that can `edit_theme_options` or edit any REST API available post type.

return: bool|WP_Error Whether the current user has permission.
param: WP_REST_Request $request Full details about the request.
since: 5.9.0

create_item( $request )   X-Ref
Creates a single post.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: WP_REST_Request $request Full details about the request.
since: 5.9.0

update_item( $request )   X-Ref
Updates a single nav menu item.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: WP_REST_Request $request Full details about the request.
since: 5.9.0

delete_item( $request )   X-Ref
Deletes a single menu item.

return: WP_REST_Response|WP_Error True on success, or WP_Error object on failure.
param: WP_REST_Request $request Full details about the request.
since: 5.9.0

prepare_item_for_database( $request )   X-Ref
Prepares a single post for create or update.

return: object|WP_Error
param: WP_REST_Request $request Request object.
since: 5.9.0

prepare_item_for_response( $item, $request )   X-Ref
Prepares a single post output for response.

return: WP_REST_Response Response object.
param: WP_Post          $item   Post object.
param: WP_REST_Request $request Request object.
since: 5.9.0

prepare_links( $post )   X-Ref
Prepares links for the request.

return: array Links for the given post.
param: WP_Post $post Post object.
since: 5.9.0

get_schema_links()   X-Ref
Retrieve Link Description Objects that should be added to the Schema for the posts collection.

return: array
since: 5.9.0

get_item_schema()   X-Ref
Retrieves the term's schema, conforming to JSON Schema.

return: array Item schema data.
since: 5.9.0

get_collection_params()   X-Ref
Retrieves the query params for the posts collection.

return: array Collection parameters.
since: 5.9.0

prepare_items_query( $prepared_args = array()   X-Ref
Determines the allowed query_vars for a get_items() response and prepares
them for WP_Query.

return: array Items query arguments.
param: array           $prepared_args Optional. Prepared WP_Query arguments. Default empty array.
param: WP_REST_Request $request       Optional. Full details about the request.
since: 5.9.0

get_menu_id( $menu_item_id )   X-Ref
Gets the id of the menu that the given menu item belongs to.

return: int
param: int $menu_item_id Menu item id.
since: 5.9.0



Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1