Property | Type | Description | |
---|---|---|---|
$namespace | string | The namespace of this controller's route. | |
$rest_base | string | The base of this controller's route. |
Method | Description | |
---|---|---|
create_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Create one item from the collection. | |
create_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Check if a given request has access to create items. | |
delete_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Delete one item from the collection. | |
delete_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Check if a given request has access to delete a specific item. | |
filter_response_by_context ( array $data, string $context ) : array | Filter a response based on the context defined in the schema. | |
get_collection_params ( ) : array | Get the query params for collections. | |
get_context_param ( array $args = [] ) : array | Get the magical context param. | |
get_endpoint_args_for_item_schema ( string $method = WP_REST_Server::CREATABLE ) : array | Get an array of endpoint arguments from the item schema for the controller. | |
get_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Get one item from the collection. | |
get_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Check if a given request has access to get a specific item. | |
get_item_schema ( ) : array | Get the item's schema, conforming to JSON Schema. | |
get_items ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Get a collection of items. | |
get_items_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Check if a given request has access to get items. | |
get_public_item_schema ( ) : array | Get the item's schema for display / public consumption purposes. | |
prepare_item_for_response ( mixed $item, WP_REST_Request $request ) : WP_REST_Response | Prepare the item for the REST response. | |
prepare_response_for_collection ( WP_REST_Response $response ) : array | Prepare a response for inserting into a collection. | |
register_routes ( ) | Register the routes for the objects of the controller. | |
update_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | Update one item from the collection. | |
update_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | Check if a given request has access to update a specific item. |
Method | Description | |
---|---|---|
add_additional_fields_schema ( array $schema ) : array | Add the schema from additional fields to an schema array. | |
add_additional_fields_to_object ( array $object, WP_REST_Request $request ) : array | Add the values from additional fields to a data object. | |
get_additional_fields ( string $object_type = null ) : array | Get all the registered additional fields for a given object-type. | |
get_object_type ( ) : string | Get the object type this controller is responsible for managing. | |
prepare_item_for_database ( WP_REST_Request $request ) : WP_Error | object | Prepare the item for create or update operation. | |
update_additional_fields_for_object ( array $object, WP_REST_Request $request ) | Update the values of additional fields added to a data object. |
protected add_additional_fields_schema ( array $schema ) : array | ||
$schema | array | Schema array. |
return | array | $schema Schema array. |
protected add_additional_fields_to_object ( array $object, WP_REST_Request $request ) : array | ||
$object | array | |
$request | WP_REST_Request | |
return | array | modified object with additional fields. |
public create_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | WP_REST_Response |
public create_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | boolean |
public delete_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | WP_REST_Response |
public delete_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | boolean |
protected get_additional_fields ( string $object_type = null ) : array | ||
$object_type | string | |
return | array |
public get_collection_params ( ) : array | ||
return | array |
public get_context_param ( array $args = [] ) : array | ||
$args | array | |
return | array |
public get_endpoint_args_for_item_schema ( string $method = WP_REST_Server::CREATABLE ) : array | ||
$method | string | HTTP method of the request. The arguments for `CREATABLE` requests are checked for required values and may fall-back to a given default, this is not done on `EDITABLE` requests. Default is WP_REST_Server::CREATABLE. |
return | array | $endpoint_args |
public get_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | WP_REST_Response |
public get_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | boolean |
public get_item_schema ( ) : array | ||
return | array |
public get_items ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | WP_REST_Response |
public get_items_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | boolean |
protected get_object_type ( ) : string | ||
return | string |
public get_public_item_schema ( ) : array | ||
return | array |
protected prepare_item_for_database ( WP_REST_Request $request ) : WP_Error | object | ||
$request | WP_REST_Request | Request object. |
return | WP_Error | object | $prepared_item |
public prepare_item_for_response ( mixed $item, WP_REST_Request $request ) : WP_REST_Response | ||
$item | mixed | WordPress representation of the item. |
$request | WP_REST_Request | Request object. |
return | WP_REST_Response | $response |
public prepare_response_for_collection ( WP_REST_Response $response ) : array | ||
$response | WP_REST_Response | Response object. |
return | array | Response data, ready for insertion into collection data. |
public register_routes ( ) |
protected update_additional_fields_for_object ( array $object, WP_REST_Request $request ) | ||
$object | array | |
$request | WP_REST_Request |
public update_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | WP_REST_Response |
public update_item_permissions_check ( WP_REST_Request $request ) : WP_Error | boolean | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_Error | boolean |
protected string $namespace | ||
return | string |
protected string $rest_base | ||
return | string |