[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

REST API: WP_REST_Themes_Controller class

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

Defines 1 class

WP_REST_Themes_Controller:: (15 methods):
  __construct()
  register_routes()
  _sanitize_stylesheet_callback()
  get_items_permissions_check()
  get_item_permissions_check()
  check_read_active_theme_permission()
  get_item()
  get_items()
  prepare_item_for_response()
  prepare_links()
  is_same_theme()
  prepare_theme_support()
  get_item_schema()
  get_collection_params()
  sanitize_theme_status()


Class: WP_REST_Themes_Controller  - X-Ref

Core class used to manage themes via the REST API.

__construct()   X-Ref
Constructor.

since: 5.0.0

register_routes()   X-Ref
Registers the routes for themes.

since: 5.0.0

_sanitize_stylesheet_callback( $stylesheet )   X-Ref
Sanitize the stylesheet to decode endpoint.

return: string Sanitized stylesheet.
since: 5.9.0
param: string $stylesheet The stylesheet name.

get_items_permissions_check( $request )   X-Ref
Checks if a given request has access to read the theme.

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

get_item_permissions_check( $request )   X-Ref
Checks if a given request has access to read the theme.

return: bool|WP_Error True if the request has read access for the item, otherwise WP_Error object.
since: 5.7.0
param: WP_REST_Request $request Full details about the request.

check_read_active_theme_permission()   X-Ref
Checks if a theme can be read.

return: bool|WP_Error Whether the theme can be read.
since: 5.7.0

get_item( $request )   X-Ref
Retrieves a single theme.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
since: 5.7.0
param: WP_REST_Request $request Full details about the request.

get_items( $request )   X-Ref
Retrieves a collection of themes.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
since: 5.0.0
param: WP_REST_Request $request Full details about the request.

prepare_item_for_response( $item, $request )   X-Ref
Prepares a single theme output for response.

return: WP_REST_Response Response object.
since: 5.0.0
since: 5.9.0 Renamed `$theme` to `$item` to match parent class for PHP 8 named parameter support.
param: WP_Theme        $item    Theme object.
param: WP_REST_Request $request Request object.

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

return: array Links for the given block type.
since: 5.7.0
param: WP_Theme $theme Theme data.

is_same_theme( $theme_a, $theme_b )   X-Ref
Helper function to compare two themes.

return: bool
since: 5.7.0
param: WP_Theme $theme_a First theme to compare.
param: WP_Theme $theme_b Second theme to compare.

prepare_theme_support( $support, $args, $feature, $request )   X-Ref
Prepares the theme support value for inclusion in the REST API response.

return: mixed The prepared support value.
since: 5.5.0
param: mixed           $support The raw value from get_theme_support().
param: array           $args    The feature's registration args.
param: string          $feature The feature name.
param: WP_REST_Request $request The request object.

get_item_schema()   X-Ref
Retrieves the theme's schema, conforming to JSON Schema.

return: array Item schema data.
since: 5.0.0

get_collection_params()   X-Ref
Retrieves the search params for the themes collection.

return: array Collection parameters.
since: 5.0.0

sanitize_theme_status( $statuses, $request, $parameter )   X-Ref
Sanitizes and validates the list of theme status.

return: array|WP_Error A list of valid statuses, otherwise WP_Error object.
since: 5.0.0
param: string|array    $statuses  One or more theme statuses.
param: WP_REST_Request $request   Full details about the request.
param: string          $parameter Additional parameter to pass to validation.



Generated: Tue Dec 24 01:00:02 2024 Cross-referenced by PHPXref 0.7.1