WC_REST_System_Status_V2_Controller::prepare_item_for_response()
Prepare the system status response
Метод класса: WC_REST_System_Status_V2_Controller{}
Хуки из метода
Возвращает
WP_REST_Response
.
Использование
$WC_REST_System_Status_V2_Controller = new WC_REST_System_Status_V2_Controller(); $WC_REST_System_Status_V2_Controller->prepare_item_for_response( $system_status, $request );
- $system_status(массив) (обязательный)
- System status data.
- $request(WP_REST_Request) (обязательный)
- Request object.
Код WC_REST_System_Status_V2_Controller::prepare_item_for_response() WC REST System Status V2 Controller::prepare item for response WC 9.4.2
public function prepare_item_for_response( $system_status, $request ) { $data = $this->add_additional_fields_to_object( $system_status, $request ); $data = $this->filter_response_by_context( $data, 'view' ); $response = rest_ensure_response( $data ); /** * Filter the system status returned from the REST API. * * @param WP_REST_Response $response The response object. * @param mixed $system_status System status * @param WP_REST_Request $request Request object. */ return apply_filters( 'woocommerce_rest_prepare_system_status', $response, $system_status, $request ); }