| [ Index ] |
PHP Cross Reference of WordPress |
[Source view] [Print] [Project Stats]
REST API: WP_REST_Controller class
| File Size: | 651 lines (19 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| register_routes() X-Ref |
| Registers the routes for the objects of the controller. since: 4.7.0 |
| get_items_permissions_check( $request ) X-Ref |
| Checks if a given request has access to get items. 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. since: 4.7.0 |
| get_items( $request ) X-Ref |
| Retrieves a collection of items. 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. since: 4.7.0 |
| get_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to get a specific item. 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. since: 4.7.0 |
| get_item( $request ) X-Ref |
| Retrieves one item from the collection. 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. since: 4.7.0 |
| create_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to create items. 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. since: 4.7.0 |
| create_item( $request ) X-Ref |
| Creates one item from the collection. 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. since: 4.7.0 |
| update_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to update a specific item. return: true|WP_Error True if the request has access to update the item, WP_Error object otherwise. param: WP_REST_Request $request Full details about the request. since: 4.7.0 |
| update_item( $request ) X-Ref |
| Updates one item from the collection. 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. since: 4.7.0 |
| delete_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to delete a specific item. 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. since: 4.7.0 |
| delete_item( $request ) X-Ref |
| Deletes one item from the collection. 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. since: 4.7.0 |
| prepare_item_for_database( $request ) X-Ref |
| Prepares one item for create or update operation. return: object|WP_Error The prepared item, or WP_Error object on failure. param: WP_REST_Request $request Request object. since: 4.7.0 |
| prepare_item_for_response( $item, $request ) X-Ref |
| Prepares the item for the REST response. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. param: mixed $item WordPress representation of the item. param: WP_REST_Request $request Request object. since: 4.7.0 |
| prepare_response_for_collection( $response ) X-Ref |
| Prepares a response for insertion into a collection. return: array|mixed Response data, ready for insertion into collection data. param: WP_REST_Response $response Response object. since: 4.7.0 |
| filter_response_by_context( $data, $context ) X-Ref |
| Filters a response based on the context defined in the schema. return: array Filtered response. param: array $data Response data to filter. param: string $context Context defined in the schema. since: 4.7.0 |
| get_item_schema() X-Ref |
| Retrieves the item's schema, conforming to JSON Schema. return: array Item schema data. since: 4.7.0 |
| get_public_item_schema() X-Ref |
| Retrieves the item's schema for display / public consumption purposes. return: array Public item schema data. since: 4.7.0 |
| get_collection_params() X-Ref |
| Retrieves the query params for the collections. return: array Query parameters for the collection. since: 4.7.0 |
| get_context_param( $args = array() X-Ref |
| Retrieves the magical context param. Ensures consistent descriptions between endpoints, and populates enum from schema. return: array Context parameter details. param: array $args Optional. Additional arguments for context parameter. Default empty array. since: 4.7.0 |
| add_additional_fields_to_object( $prepared, $request ) X-Ref |
| Adds the values from additional fields to a data object. return: array Modified data object with additional fields. param: array $prepared Prepared response array. param: WP_REST_Request $request Full details about the request. since: 4.7.0 |
| update_additional_fields_for_object( $object, $request ) X-Ref |
| Updates the values of additional fields added to a data object. return: true|WP_Error True on success, WP_Error object if a field cannot be updated. param: object $object Data model like WP_Term or WP_Post. param: WP_REST_Request $request Full details about the request. since: 4.7.0 |
| add_additional_fields_schema( $schema ) X-Ref |
| Adds the schema from additional fields to a schema array. The type of object is inferred from the passed schema. return: array Modified Schema array. param: array $schema Schema array. since: 4.7.0 |
| get_additional_fields( $object_type = null ) X-Ref |
| Retrieves all of the registered additional fields for a given object-type. return: array Registered additional fields (if any), empty array if none or if the object type param: string $object_type Optional. The object type. since: 4.7.0 |
| get_object_type() X-Ref |
| Retrieves the object type this controller is responsible for managing. return: string Object type for the controller. since: 4.7.0 |
| get_fields_for_response( $request ) X-Ref |
| Gets an array of fields to be included on the response. Included fields are based on item schema and `_fields=` request argument. return: string[] Fields to be included in the response. param: WP_REST_Request $request Full details about the request. since: 4.9.6 |
| get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) X-Ref |
| No description |
| sanitize_slug( $slug ) X-Ref |
| Sanitizes the slug value. return: string Sanitized value for the slug. param: string $slug Slug value passed in request. since: 4.7.0 |
| Generated: Tue Oct 28 01:00:02 2025 | Cross-referenced by PHPXref 0.7.1 |