[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/rest-api/endpoints/ -> class-wp-rest-template-revisions-controller.php (summary)

REST API: WP_REST_Template_Revisions_Controller class

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

Defines 1 class

WP_REST_Template_Revisions_Controller:: (7 methods):
  __construct()
  register_routes()
  get_parent()
  prepare_item_for_response()
  delete_item_permissions_check()
  prepare_links()
  get_item_schema()


Class: WP_REST_Template_Revisions_Controller  - X-Ref

Core class used to access template revisions via the REST API.

__construct( $parent_post_type )   X-Ref
Constructor.

param: string $parent_post_type Post type of the parent.

register_routes()   X-Ref
Registers the routes for revisions based on post types supporting revisions.


get_parent( $parent_post_id )   X-Ref
Gets the parent post, if the ID is valid.

return: WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise.
param: int $parent_post_id Supplied ID.

prepare_item_for_response( $item, $request )   X-Ref
Prepares the item for the REST response.

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

delete_item_permissions_check( $request )   X-Ref
Checks if a given request has access to delete a revision.

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

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

return: array Links for the given post.
param: WP_Block_Template $template Template.

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

return: array Item schema data.



Generated : Sat Apr 27 08:20:02 2024 Cross-referenced by PHPXref