[ 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. 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. |
get_items( $request ) X-Ref |
Retrieves a collection of widgets. param: WP_REST_Request $request Full details about the request. return: WP_REST_Response Response object. |
get_item_permissions_check( $request ) X-Ref |
Checks if a given request has access to get a widget. 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_sidebar_permission( $sidebar_id ) X-Ref |
Checks if a sidebar can be read publicly. param: string $sidebar_id The sidebar ID. return: bool Whether the sidebar can be read. |
get_item( $request ) X-Ref |
Gets an individual widget. 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. |
create_item_permissions_check( $request ) X-Ref |
Checks if a given request has access to create widgets. 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. |
create_item( $request ) X-Ref |
Creates a widget. 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. |
update_item_permissions_check( $request ) X-Ref |
Checks if a given request has access to update widgets. 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. |
update_item( $request ) X-Ref |
Updates an existing widget. 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. |
delete_item_permissions_check( $request ) X-Ref |
Checks if a given request has access to delete widgets. 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. |
delete_item( $request ) X-Ref |
Deletes a widget. 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. |
permissions_check( $request ) X-Ref |
Performs a permissions check for managing widgets. param: WP_REST_Request $request Full details about the request. return: true|WP_Error |
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. param: WP_REST_Request $request Full details about the request. param: string $sidebar_id ID of the sidebar the widget belongs to. return: string|WP_Error The saved widget ID. |
prepare_item_for_response( $item, $request ) X-Ref |
Prepares the widget for the REST response. param: array $item An array containing a widget_id and sidebar_id. param: WP_REST_Request $request Request object. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
prepare_links( $prepared ) X-Ref |
Prepares links for the widget. param: array $prepared Widget. return: array Links for the given 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 : Wed Dec 25 08:20:01 2024 | Cross-referenced by PHPXref |