Automattic\WooCommerce\Internal\Orders

OrderActionsRestController::runprotectedWC 1.0

Handle a request for one of the provided REST API endpoints.

Method of the class: OrderActionsRestController{}

No Hooks.

Returns

WP_REST_Response|WP_Error.

Usage

// protected - for code of main (parent) or child class
$result = $this->run( $request, $method_name );
$request(WP_REST_Request) (required)
The incoming HTTP REST request.
$method_name(string) (required)
The name of the class method to execute.

OrderActionsRestController::run() code WC 9.9.3

protected function run( WP_REST_Request $request, string $method_name ) {
	$order_id = $this->validate_order_id( $request );

	if ( is_wp_error( $order_id ) ) {
		return $order_id;
	}

	return parent::run( $request, $method_name );
}