Automattic\WooCommerce\Internal\ReceiptRendering
ReceiptRenderingRestController::register_routes
Register the REST API endpoints handled by this controller.
Метод класса: ReceiptRenderingRestController{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ReceiptRenderingRestController = new ReceiptRenderingRestController(); $ReceiptRenderingRestController->register_routes();
Код ReceiptRenderingRestController::register_routes() ReceiptRenderingRestController::register routes WC 10.3.6
public function register_routes() {
register_rest_route(
$this->route_namespace,
'/orders/(?P<id>[\d]+)/receipt',
array(
array(
'methods' => WP_REST_Server::CREATABLE,
'callback' => fn( $request ) => $this->run( $request, 'create_order_receipt' ),
'permission_callback' => fn( $request ) => $this->check_permission( $request, 'read_shop_order', $request->get_param( 'id' ) ),
'args' => $this->get_args_for_create_order_receipt(),
'schema' => $this->get_schema_for_get_and_post_order_receipt(),
),
)
);
register_rest_route(
$this->route_namespace,
'/orders/(?P<id>[\d]+)/receipt',
array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => fn( $request ) => $this->run( $request, 'get_order_receipt' ),
'permission_callback' => fn( $request ) => $this->check_permission( $request, 'read_shop_order', $request->get_param( 'id' ) ),
'args' => $this->get_args_for_get_order_receipt(),
'schema' => $this->get_schema_for_get_and_post_order_receipt(),
),
)
);
}