Automattic\WooCommerce\Admin\Features\Fulfillments
OrderFulfillmentsRestController::prepare_error_response
Prepare an error response.
Метод класса: OrderFulfillmentsRestController{}
Хуков нет.
Возвращает
WP_REST_Response. The error response.
Использование
// private - только в коде основоного (родительского) класса $result = $this->prepare_error_response( $code, $message, $status ): WP_REST_Response;
- $code(строка) (обязательный)
- The error code.
- $message(строка) (обязательный)
- The error message.
- $status(int) (обязательный)
- The HTTP status code.
Код OrderFulfillmentsRestController::prepare_error_response() OrderFulfillmentsRestController::prepare error response WC 11.1.2
private function prepare_error_response( $code, $message, $status ): WP_REST_Response {
return new WP_REST_Response(
array(
'code' => $code,
'message' => $message,
'data' => array( 'status' => $status ),
),
$status
);
}