Method | Description | |
---|---|---|
__construct ( string $parent_post_type ) | Constructor. | |
delete_item ( WP_REST_Request $request ) : true | WP_Error | Deletes a single revision. | |
delete_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | Checks if a given request has access to delete a revision. | |
get_collection_params ( ) : array | Retrieves the query params for collections. | |
get_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | Retrieves one revision from the collection. | |
get_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | Checks if a given request has access to get a specific revision. | |
get_item_schema ( ) : array | Retrieves the revision's schema, conforming to JSON Schema. | |
get_items ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | Gets a collection of revisions. | |
get_items_permissions_check ( WP_REST_Request $request ) : true | WP_Error | Checks if a given request has access to get revisions. | |
prepare_item_for_response ( WP_Post $post, WP_REST_Request $request ) : WP_REST_Response | Prepares the revision for the REST response. | |
register_routes ( ) | Registers routes for revisions based on post types supporting revisions. |
Method | Description | |
---|---|---|
prepare_date_response ( string $date_gmt, string | null $date = null ) : string | null | Checks the post_date_gmt or modified_gmt and prepare any post or modified date for single post output. | |
prepare_excerpt_response ( string $excerpt, WP_Post $post ) : string | Checks the post excerpt and prepare it for single post output. |
public __construct ( string $parent_post_type ) | ||
$parent_post_type | string | Post type of the parent. |
public delete_item ( WP_REST_Request $request ) : true | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | true | WP_Error | True on success, or WP_Error object on failure. |
public delete_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | boolean | WP_Error | True if the request has access to delete the item, WP_Error object otherwise. |
public get_collection_params ( ) : array | ||
return | array | Collection parameters. |
public get_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_REST_Response | WP_Error | Response object on success, or WP_Error object on failure. |
public get_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | ||
$request | WP_REST_Request | Full data about the request. |
return | boolean | WP_Error | True if the request has read access for the item, WP_Error object otherwise. |
public get_item_schema ( ) : array | ||
return | array | Item schema data. |
public get_items ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | ||
$request | WP_REST_Request | Full data about the request. |
return | WP_REST_Response | WP_Error | Response object on success, or WP_Error object on failure. |
public get_items_permissions_check ( WP_REST_Request $request ) : true | WP_Error | ||
$request | WP_REST_Request | Full data about the request. |
return | true | WP_Error | True if the request has read access, WP_Error object otherwise. |
protected prepare_excerpt_response ( string $excerpt, WP_Post $post ) : string | ||
$excerpt | string | The post excerpt. |
$post | WP_Post | Post revision object. |
return | string | Prepared excerpt or empty string. |
public prepare_item_for_response ( WP_Post $post, WP_REST_Request $request ) : WP_REST_Response | ||
$post | WP_Post | Post revision object. |
$request | WP_REST_Request | Request object. |
return | WP_REST_Response | Response object. |
public register_routes ( ) |