[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
REST API: WP_REST_Revisions_Controller class
File Size: | 869 lines (26 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
WP_REST_Revisions_Controller:: (16 methods):
__construct()
register_routes()
get_parent()
get_items_permissions_check()
get_revision()
get_items()
get_item_permissions_check()
get_item()
delete_item_permissions_check()
delete_item()
prepare_items_query()
prepare_item_for_response()
prepare_date_response()
get_item_schema()
get_collection_params()
prepare_excerpt_response()
Class: WP_REST_Revisions_Controller - X-Ref
Core class used to access 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 |
Get the parent post, if the ID is valid. param: int $parent_post_id Supplied ID. return: WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. |
get_items_permissions_check( $request ) X-Ref |
Checks if a given request has access to get revisions. param: WP_REST_Request $request Full details about the request. return: true|WP_Error True if the request has read access, WP_Error object otherwise. |
get_revision( $id ) X-Ref |
Get the revision, if the ID is valid. param: int $id Supplied ID. return: WP_Post|WP_Error Revision post object if ID is valid, WP_Error otherwise. |
get_items( $request ) X-Ref |
Gets a collection of revisions. param: WP_REST_Request $request Full details about the request. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
get_item_permissions_check( $request ) X-Ref |
Checks if a given request has access to get a specific revision. param: WP_REST_Request $request Full details about the request. return: true|WP_Error True if the request has read access for the item, WP_Error object otherwise. |
get_item( $request ) X-Ref |
Retrieves one revision from the collection. param: WP_REST_Request $request Full details about the request. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
delete_item_permissions_check( $request ) X-Ref |
Checks if a given request has access to delete a revision. param: WP_REST_Request $request Full details about the request. return: true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. |
delete_item( $request ) X-Ref |
Deletes a single revision. param: WP_REST_Request $request Full details about the request. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
prepare_items_query( $prepared_args = array() X-Ref |
Determines the allowed query_vars for a get_items() response and prepares them for WP_Query. param: array $prepared_args Optional. Prepared WP_Query arguments. Default empty array. param: WP_REST_Request $request Optional. Full details about the request. return: array Items query arguments. |
prepare_item_for_response( $item, $request ) X-Ref |
Prepares the revision for the REST response. param: WP_Post $item Post revision object. param: WP_REST_Request $request Request object. return: WP_REST_Response Response object. |
prepare_date_response( $date_gmt, $date = null ) X-Ref |
Checks the post_date_gmt or modified_gmt and prepare any post or modified date for single post output. param: string $date_gmt GMT publication time. param: string|null $date Optional. Local publication time. Default null. return: string|null ISO8601/RFC3339 formatted datetime, otherwise null. |
get_item_schema() X-Ref |
Retrieves the revision's schema, conforming to JSON Schema. return: array Item schema data. |
get_collection_params() X-Ref |
Retrieves the query params for collections. return: array Collection parameters. |
prepare_excerpt_response( $excerpt, $post ) X-Ref |
Checks the post excerpt and prepare it for single post output. param: string $excerpt The post excerpt. param: WP_Post $post Post revision object. return: string Prepared excerpt or empty string. |
Generated : Tue Dec 24 08:20:01 2024 | Cross-referenced by PHPXref |