[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/rest-api/endpoints/ -> class-wp-rest-global-styles-revisions-controller.php (summary)

REST API: WP_REST_Global_Styles_Revisions_Controller class

File Size: 394 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_REST_Global_Styles_Revisions_Controller:: (7 methods):
  __construct()
  register_routes()
  get_decoded_global_styles_json()
  get_items()
  prepare_item_for_response()
  get_item_schema()
  get_collection_params()


Class: WP_REST_Global_Styles_Revisions_Controller  - X-Ref

Core class used to access global styles revisions via the REST API.

__construct( $parent_post_type = 'wp_global_styles' )   X-Ref
Constructor.

param: string $parent_post_type Post type of the parent.

register_routes()   X-Ref
Registers the controller's routes.


get_decoded_global_styles_json( $raw_json )   X-Ref
Returns decoded JSON from post content string,
or a 404 if not found.

param: string $raw_json Encoded JSON from global styles custom post content.
return: Array|WP_Error

get_items( $request )   X-Ref
Returns paginated revisions of the given global styles config custom post type.

The bulk of the body is taken from WP_REST_Revisions_Controller->get_items,
but global styles does not require as many parameters.

param: WP_REST_Request $request The request instance.
return: WP_REST_Response|WP_Error

prepare_item_for_response( $post, $request )   X-Ref
Prepares the revision for the REST response.

param: WP_Post         $post    Post revision object.
param: WP_REST_Request $request Request object.
return: WP_REST_Response|WP_Error Response object.

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.
Removes params that are not supported by global styles revisions.

return: array Collection parameters.



Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref