[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

REST API: WP_REST_Global_Styles_Controller class

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

Defines 1 class

WP_REST_Global_Styles_Controller:: (21 methods):
  __construct()
  register_routes()
  _sanitize_global_styles_callback()
  get_item_permissions_check()
  check_read_permission()
  get_item()
  update_item_permissions_check()
  check_update_permission()
  update_item()
  prepare_item_for_database()
  prepare_item_for_response()
  get_post()
  prepare_links()
  get_available_actions()
  protected_title_format()
  get_collection_params()
  get_item_schema()
  get_theme_item_permissions_check()
  get_theme_item()
  get_theme_items_permissions_check()
  get_theme_items()


Class: WP_REST_Global_Styles_Controller  - X-Ref

Base Global Styles REST API Controller.

__construct()   X-Ref
Constructor.

since: 5.9.0

register_routes()   X-Ref
Registers the controllers routes.

since: 5.9.0
return: void

_sanitize_global_styles_callback( $id_or_stylesheet )   X-Ref
Sanitize the global styles ID or stylesheet to decode endpoint.
For example, `wp/v2/global-styles/twentytwentytwo%200.4.0`
would be decoded to `twentytwentytwo 0.4.0`.

since: 5.9.0
param: string $id_or_stylesheet Global styles ID or stylesheet.
return: string Sanitized global styles ID or stylesheet.

get_item_permissions_check( $request )   X-Ref
Checks if a given request has access to read a single global style.

since: 5.9.0
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.

check_read_permission( $post )   X-Ref
Checks if a global style can be read.

since: 5.9.0
param: WP_Post $post Post object.
return: bool Whether the post can be read.

get_item( $request )   X-Ref
Returns the given global styles config.

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

update_item_permissions_check( $request )   X-Ref
Checks if a given request has access to write a single global styles config.

since: 5.9.0
param: WP_REST_Request $request Full details about the request.
return: true|WP_Error True if the request has write access for the item, WP_Error object otherwise.

check_update_permission( $post )   X-Ref
Checks if a global style can be edited.

since: 5.9.0
param: WP_Post $post Post object.
return: bool Whether the post can be edited.

update_item( $request )   X-Ref
Updates a single global style config.

since: 5.9.0
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_item_for_database( $request )   X-Ref
Prepares a single global styles config for update.

since: 5.9.0
param: WP_REST_Request $request Request object.
return: stdClass Changes to pass to wp_update_post.

prepare_item_for_response( $post, $request )   X-Ref
Prepare a global styles config output for response.

since: 5.9.0
param: WP_Post         $post    Global Styles post object.
param: WP_REST_Request $request Request object.
return: WP_REST_Response Response object.

get_post( $id )   X-Ref
Get the post, if the ID is valid.

since: 5.9.0
param: int $id Supplied ID.
return: WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise.

prepare_links( $id )   X-Ref
Prepares links for the request.

since: 5.9.0
param: integer $id ID.
return: array Links for the given post.

get_available_actions()   X-Ref
Get the link relations available for the post and current user.

since: 5.9.0
return: array List of link relations.

protected_title_format()   X-Ref
Overwrites the default protected title format.

By default, WordPress will show password protected posts with a title of
"Protected: %s", as the REST API communicates the protected status of a post
in a machine readable format, we remove the "Protected: " prefix.

since: 5.9.0
return: string Protected title format.

get_collection_params()   X-Ref
Retrieves the query params for the global styles collection.

since: 5.9.0
return: array Collection parameters.

get_item_schema()   X-Ref
Retrieves the global styles type' schema, conforming to JSON Schema.

since: 5.9.0
return: array Item schema data.

get_theme_item_permissions_check( $request )   X-Ref
Checks if a given request has access to read a single theme global styles config.

since: 5.9.0
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_theme_item( $request )   X-Ref
Returns the given theme global styles config.

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

get_theme_items_permissions_check( $request )   X-Ref
Checks if a given request has access to read a single theme global styles config.

since: 6.0.0
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_theme_items( $request )   X-Ref
Returns the given theme global styles variations.

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



Generated: Tue Jun 28 01:00:03 2022 Cross-referenced by PHPXref 0.7.1