WC_REST_System_Status_Tools_V2_Controller::get_items()publicWC 1.0

Get a list of system status tools.

Method of the class: WC_REST_System_Status_Tools_V2_Controller{}

No Hooks.

Return

WP_Error|WP_REST_Response.

Usage

$WC_REST_System_Status_Tools_V2_Controller = new WC_REST_System_Status_Tools_V2_Controller();
$WC_REST_System_Status_Tools_V2_Controller->get_items( $request );
$request(WP_REST_Request) (required)
Full details about the request.

WC_REST_System_Status_Tools_V2_Controller::get_items() code WC 8.7.0

public function get_items( $request ) {
	$tools = array();
	foreach ( $this->get_tools() as $id => $tool ) {
		$tools[] = $this->prepare_response_for_collection(
			$this->prepare_item_for_response(
				array(
					'id'          => $id,
					'name'        => $tool['name'],
					'action'      => $tool['button'],
					'description' => $tool['desc'],
				),
				$request
			)
		);
	}

	$response = rest_ensure_response( $tools );
	return $response;
}