[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/rest-api/endpoints/ -> class-wp-rest-navigation-fallback-controller.php (summary)

WP_REST_Navigation_Fallback_Controller class REST Controller to create/fetch a fallback Navigation Menu.

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

Defines 1 class

WP_REST_Navigation_Fallback_Controller:: (7 methods):
  __construct()
  register_routes()
  get_item_permissions_check()
  get_item()
  get_item_schema()
  prepare_item_for_response()
  prepare_links()


Class: WP_REST_Navigation_Fallback_Controller  - X-Ref

REST Controller to fetch a fallback Navigation Block Menu. If needed it creates one.

__construct()   X-Ref
Constructs the controller.


register_routes()   X-Ref
Registers the controllers routes.


get_item_permissions_check( $request )   X-Ref
Checks if a given request has access to read fallbacks.

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

get_item( $request )   X-Ref
Gets the most appropriate fallback Navigation Menu.

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

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

return: array Item schema data.

prepare_item_for_response( $item, $request )   X-Ref
Matches the post data to the schema we want.

param: WP_Post         $item    The wp_navigation Post object whose response is being prepared.
param: WP_REST_Request $request Request object.
return: WP_REST_Response $response The response data.

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

param: WP_Post $post the Navigation Menu post object.
return: array Links for the given request.



Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref