WP_REST_Plugins_Controller8b7c:f320:99b9:690f:4595:cd17:293a:c069get_items( WP_REST_Request $request ): WP_REST_Response|WP_Error  Retrieves a collection of plugins.   Parameters   $request WP_REST_Request Required    Full details about the request.      Return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.   Source  File: wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php. View all references  public function get_items( $request ) {
	require_once ABSPATH . 'wp-admin/includes/plugin.php';

	$plugins = array();

	foreach ( get_plugins() as $file => $data ) {
		if ( is_wp_error( $this->check_read_permission( $file ) ) ) {
			continue;
		}

		$data['_file'] = $file;

		if ( ! $this->does_plugin_match_request( $request, $data ) ) {
			continue;
		}

		$plugins[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $data, $request ) );
	}

	return new WP_REST_Response( $plugins );
}
   Related  Uses    Uses Description      WP_REST_Plugins_Controller8b7c:f320:99b9:690f:4595:cd17:293a:c069oes_plugin_match_request() wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php   Checks if the plugin matches the requested parameters.     WP_REST_Plugins_Controller8b7c:f320:99b9:690f:4595:cd17:293a:c069heck_read_permission() wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php   Checks if the given plugin can be viewed by the current user.     WP_REST_Plugins_Controller8b7c:f320:99b9:690f:4595:cd17:293a:c069prepare_item_for_response() wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php   Prepares the plugin for the REST response.     get_plugins() wp-admin/includes/plugin.php   Checks the plugins directory and retrieve all plugin files with plugin data.     is_wp_error() wp-includes/load.php   Checks whether the given variable is a WordPress Error.   
    Changelog    Version Description     5.5.0 Introduced.    

    
{'path': 'public/docs/wordpress/classes/wp_rest_plugins_controller/get_items.html', 'source': 'DevDocs.IO'}