[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
REST API: WP_REST_Widgets_Controller class
File Size: | 876 lines (26 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 1 file wp-admin/includes/widgets.php |
WP_REST_Widgets_Controller:: (20 methods):
__construct()
register_routes()
get_items_permissions_check()
get_items()
get_item_permissions_check()
check_read_sidebar_permission()
get_item()
create_item_permissions_check()
create_item()
update_item_permissions_check()
update_item()
delete_item_permissions_check()
delete_item()
permissions_check()
retrieve_widgets()
save_widget()
prepare_item_for_response()
prepare_links()
get_collection_params()
get_item_schema()
Class: WP_REST_Widgets_Controller - X-Ref
Core class to access widgets via the REST API.__construct() X-Ref |
Widgets controller constructor. |
register_routes() X-Ref |
Registers the widget routes for the controller. |
get_items_permissions_check( $request ) X-Ref |
Checks if a given request has access to get widgets. 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. |
get_items( $request ) X-Ref |
Retrieves a collection of widgets. return: WP_REST_Response Response object. 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 get a widget. 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. |
check_read_sidebar_permission( $sidebar_id ) X-Ref |
Checks if a sidebar can be read publicly. return: bool Whether the sidebar can be read. param: string $sidebar_id The sidebar ID. |
get_item( $request ) X-Ref |
Gets an individual widget. 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. |
create_item_permissions_check( $request ) X-Ref |
Checks if a given request has access to create widgets. 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. |
create_item( $request ) X-Ref |
Creates a widget. 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. |
update_item_permissions_check( $request ) X-Ref |
Checks if a given request has access to update widgets. 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. |
update_item( $request ) X-Ref |
Updates an existing widget. 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. |
delete_item_permissions_check( $request ) X-Ref |
Checks if a given request has access to delete widgets. 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. |
delete_item( $request ) X-Ref |
Deletes a widget. 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. |
permissions_check( $request ) X-Ref |
Performs a permissions check for managing widgets. return: true|WP_Error param: WP_REST_Request $request Full details about the request. |
retrieve_widgets() X-Ref |
Looks for "lost" widgets once per request. |
save_widget( $request, $sidebar_id ) X-Ref |
Saves the widget in the request object. return: string|WP_Error The saved widget ID. param: WP_REST_Request $request Full details about the request. param: string $sidebar_id ID of the sidebar the widget belongs to. |
prepare_item_for_response( $item, $request ) X-Ref |
Prepares the widget for the REST response. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. param: array $item An array containing a widget_id and sidebar_id. param: WP_REST_Request $request Request object. |
prepare_links( $prepared ) X-Ref |
Prepares links for the widget. return: array Links for the given widget. param: array $prepared Widget. |
get_collection_params() X-Ref |
Gets the list of collection params. return: array[] |
get_item_schema() X-Ref |
Retrieves the widget's schema, conforming to JSON Schema. return: array Item schema data. |
Generated : Sat Nov 23 08:20:01 2024 | Cross-referenced by PHPXref |