[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

REST API: WP_REST_Templates_Controller class

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

Defines 1 class

WP_REST_Templates_Controller:: (19 methods):
  __construct()
  register_routes()
  permissions_check()
  get_items_permissions_check()
  get_items()
  get_item_permissions_check()
  get_item()
  update_item_permissions_check()
  update_item()
  create_item_permissions_check()
  create_item()
  delete_item_permissions_check()
  delete_item()
  prepare_item_for_database()
  prepare_item_for_response()
  prepare_links()
  get_available_actions()
  get_collection_params()
  get_item_schema()


Class: WP_REST_Templates_Controller  - X-Ref

Base Templates REST API Controller.

__construct( $post_type )   X-Ref
Constructor.

since: 5.8.0
param: string $post_type Post type.

register_routes()   X-Ref
Registers the controllers routes.

since: 5.8.0

permissions_check( $request )   X-Ref
Checks if the user has permissions to make the request.

since: 5.8.0
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.

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

since: 5.8.0
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.

get_items( $request )   X-Ref
Returns a list of templates.

since: 5.8.0
return: WP_REST_Response
param: WP_REST_Request $request The request instance.

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

since: 5.8.0
return: true|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.

get_item( $request )   X-Ref
Returns the given template

since: 5.8.0
return: WP_REST_Response|WP_Error
param: WP_REST_Request $request The request instance.

update_item_permissions_check( $request )   X-Ref
Checks if a given request has access to write a single template.

since: 5.8.0
return: true|WP_Error True if the request has write access for the item, WP_Error object otherwise.
param: WP_REST_Request $request Full details about the request.

update_item( $request )   X-Ref
Updates a single template.

since: 5.8.0
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.

create_item_permissions_check( $request )   X-Ref
Checks if a given request has access to create a template.

since: 5.8.0
return: true|WP_Error True if the request has access to create items, WP_Error object otherwise.
param: WP_REST_Request $request Full details about the request.

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

since: 5.8.0
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.

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

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

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

since: 5.8.0
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.

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

since: 5.8.0
return: stdClass Changes to pass to wp_update_post.
param: WP_REST_Request $request Request object.

prepare_item_for_response( $template, $request )   X-Ref
Prepare a single template output for response

since: 5.8.0
return: WP_REST_Response $data
param: WP_Block_Template $template Template instance.
param: WP_REST_Request   $request Request object.

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

since: 5.8.0
return: array Links for the given post.
param: integer $id ID.

get_available_actions()   X-Ref
Get the link relations available for the post and current user.

since: 5.8.0
return: string[] List of link relations.

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

since: 5.8.0
return: array Collection parameters.

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

since: 5.8.0
return: array Item schema data.



Generated: Sat Jul 24 01:00:05 2021 Cross-referenced by PHPXref 0.7.1