| [ Index ] |
PHP Cross Reference of WordPress |
[Source view] [Print] [Project Stats]
REST API: WP_REST_Plugins_Controller class
| File Size: | 992 lines (28 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
WP_REST_Plugins_Controller:: (26 methods):
__construct()
register_routes()
get_items_permissions_check()
get_items()
get_item_permissions_check()
get_item()
check_read_permission()
create_item_permissions_check()
create_item()
update_item_permissions_check()
update_item()
delete_item_permissions_check()
delete_item()
prepare_item_for_response()
prepare_links()
get_plugin_data()
get_plugin_status()
plugin_status_permission_check()
handle_plugin_status()
validate_plugin_param()
sanitize_plugin_param()
does_plugin_match_request()
is_plugin_installed()
is_filesystem_available()
get_item_schema()
get_collection_params()
Class: WP_REST_Plugins_Controller - X-Ref
Core class to access plugins via the REST API.| __construct() X-Ref |
| Plugins controller constructor. since: 5.5.0 |
| register_routes() X-Ref |
| Registers the routes for the plugins controller. since: 5.5.0 |
| get_items_permissions_check( $request ) X-Ref |
| Checks if a given request has access to get plugins. param: WP_REST_Request $request Full details about the request. since: 5.5.0 return: true|WP_Error True if the request has read access, WP_Error object otherwise. |
| get_items( $request ) X-Ref |
| Retrieves a collection of plugins. param: WP_REST_Request $request Full details about the request. since: 5.5.0 return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
| get_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to get a specific plugin. param: WP_REST_Request $request Full details about the request. since: 5.5.0 return: true|WP_Error True if the request has read access for the item, WP_Error object otherwise. |
| get_item( $request ) X-Ref |
| Retrieves one plugin from the site. param: WP_REST_Request $request Full details about the request. since: 5.5.0 return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
| check_read_permission( $plugin ) X-Ref |
| Checks if the given plugin can be viewed by the current user. On multisite, this hides non-active network only plugins if the user does not have permission to manage network plugins. param: string $plugin The plugin file to check. since: 5.5.0 return: true|WP_Error True if can read, a WP_Error instance otherwise. |
| create_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to upload plugins. param: WP_REST_Request $request Full details about the request. since: 5.5.0 return: true|WP_Error True if the request has access to create items, WP_Error object otherwise. |
| create_item( $request ) X-Ref |
| Uploads a plugin and optionally activates it. param: WP_REST_Request $request Full details about the request. since: 5.5.0 return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
| update_item_permissions_check( $request ) X-Ref |
| No description |
| update_item( $request ) X-Ref |
| Updates one plugin. param: WP_REST_Request $request Full details about the request. since: 5.5.0 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 a specific plugin. param: WP_REST_Request $request Full details about the request. since: 5.5.0 return: true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. |
| delete_item( $request ) X-Ref |
| Deletes one plugin from the site. param: WP_REST_Request $request Full details about the request. since: 5.5.0 return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
| prepare_item_for_response( $item, $request ) X-Ref |
| Prepares the plugin for the REST response. param: mixed $item Unmarked up and untranslated plugin data from {@see get_plugin_data()}. param: WP_REST_Request $request Request object. since: 5.5.0 return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
| prepare_links( $item ) X-Ref |
| Prepares links for the request. param: array $item The plugin item. since: 5.5.0 return: array[] |
| get_plugin_data( $plugin ) X-Ref |
| Gets the plugin header data for a plugin. param: string $plugin The plugin file to get data for. since: 5.5.0 return: array|WP_Error The plugin data, or a WP_Error if the plugin is not installed. |
| get_plugin_status( $plugin ) X-Ref |
| Get's the activation status for a plugin. param: string $plugin The plugin file to check. since: 5.5.0 return: string Either 'network-active', 'active' or 'inactive'. |
| plugin_status_permission_check( $plugin, $new_status, $current_status ) X-Ref |
| Handle updating a plugin's status. param: string $plugin The plugin file to update. param: string $new_status The plugin's new status. param: string $current_status The plugin's current status. since: 5.5.0 return: true|WP_Error |
| handle_plugin_status( $plugin, $new_status, $current_status ) X-Ref |
| Handle updating a plugin's status. param: string $plugin The plugin file to update. param: string $new_status The plugin's new status. param: string $current_status The plugin's current status. since: 5.5.0 return: true|WP_Error |
| validate_plugin_param( $file ) X-Ref |
| Checks that the "plugin" parameter is a valid path. param: string $file The plugin file parameter. since: 5.5.0 return: bool |
| sanitize_plugin_param( $file ) X-Ref |
| Sanitizes the "plugin" parameter to be a proper plugin file with ".php" appended. param: string $file The plugin file parameter. since: 5.5.0 return: string |
| does_plugin_match_request( $request, $item ) X-Ref |
| Checks if the plugin matches the requested parameters. param: WP_REST_Request $request The request to require the plugin matches against. param: array $item The plugin item. since: 5.5.0 return: bool |
| is_plugin_installed( $plugin ) X-Ref |
| Checks if the plugin is installed. param: string $plugin The plugin file. since: 5.5.0 return: bool |
| is_filesystem_available() X-Ref |
| Determine if the endpoints are available. Only the 'Direct' filesystem transport, and SSH/FTP when credentials are stored are supported at present. since: 5.5.0 return: true|WP_Error True if filesystem is available, WP_Error otherwise. |
| get_item_schema() X-Ref |
| Retrieves the plugin's schema, conforming to JSON Schema. since: 5.5.0 return: array Item schema data. |
| get_collection_params() X-Ref |
| Retrieves the query params for the collections. since: 5.5.0 return: array Query parameters for the collection. |
| Generated: Mon Dec 8 01:00:03 2025 | Cross-referenced by PHPXref 0.7.1 |