WPDev.one
Core Class

WP_REST_Templates_Controller

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

Base Templates REST API Controller.

Methods 23 methods

Method / Return Description
__construct()
void

Constructor.

Parameters: $post_type: mixed
register_routes()
void

Registers the controllers routes.

get_template_fallback()
(WP_REST_Response

Returns the fallback template for the given slug.

Parameters: $request: mixed
permissions_check()
(true

Checks if the user has permissions to make the request.

Parameters: $request: mixed
_sanitize_template_id()
string

Requesting this endpoint for a template like 'twentytwentytwo//home'

Parameters: $id: mixed
get_items_permissions_check()
(true

Checks if a given request has access to read templates.

Parameters: $request: mixed
get_items()
WP_REST_Response

Returns a list of templates.

Parameters: $request: mixed
get_item_permissions_check()
(true

Checks if a given request has access to read a single template.

Parameters: $request: mixed
get_item()
(WP_REST_Response

Returns the given template

Parameters: $request: mixed
update_item_permissions_check()
(true

Checks if a given request has access to write a single template.

Parameters: $request: mixed
update_item()
(WP_REST_Response

Updates a single template.

Parameters: $request: mixed
create_item_permissions_check()
(true

Checks if a given request has access to create a template.

Parameters: $request: mixed
create_item()
(WP_REST_Response

Creates a single template.

Parameters: $request: mixed
delete_item_permissions_check()
(true

Checks if a given request has access to delete a single template.

Parameters: $request: mixed
delete_item()
(WP_REST_Response

Deletes a single template.

Parameters: $request: mixed
prepare_item_for_database()
(stdClass

Prepares a single template for create or update.

Parameters: $request: mixed
prepare_item_for_response()
WP_REST_Response

Prepare a single template output for response

Parameters: $item: mixed, $request: mixed
get_wp_templates_original_source_field()
string

Returns the source from where the template originally comes from.

Parameters: $template_object: mixed
get_wp_templates_author_text_field()
string

Returns a human readable text for the author of the template.

Parameters: $template_object: mixed
prepare_links()
array

Prepares links for the request.

Parameters: $id: mixed
get_available_actions()
string[]

Get the link relations available for the post and current user.

get_collection_params()
array

Retrieves the query params for the posts collection.

get_item_schema()
array

Retrieves the block type' schema, conforming to JSON Schema.

Properties

Property / Type Description
$post_type
mixed
public
No description available.

Class Information

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