[ 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.

return: void
since: 5.9.0

_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`.

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

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

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

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

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

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

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

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

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

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

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

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

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

prepare_item_for_database( $request )   X-Ref
Prepares a single global styles config for update.

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

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

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

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

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

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

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

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

return: array List of link relations.
since: 5.9.0

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.

return: string Protected title format.
since: 5.9.0

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

return: array Collection parameters.
since: 5.9.0

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

return: array Item schema data.
since: 5.9.0

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

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

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

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

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

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: 6.0.0

get_theme_items( $request )   X-Ref
Returns the given theme global styles variations.

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



Generated: Sat Nov 23 01:00:02 2024 Cross-referenced by PHPXref 0.7.1