WC_REST_System_Status_Tools_V2_Controller::get_items
Get a list of system status tools.
Метод класса: WC_REST_System_Status_Tools_V2_Controller{}
Хуков нет.
Возвращает
WP_Error|WP_REST_Response.
Использование
$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) (обязательный)
- Full details about the request.
Код WC_REST_System_Status_Tools_V2_Controller::get_items() WC REST System Status Tools V2 Controller::get items WC 10.4.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;
}