Automattic\WooCommerce\Internal\RestApi\Routes\V4\Orders
Controller::is_valid_order_for_request
Check if an order is valid.
Method of the class: Controller{}
No Hooks.
Returns
true|false. True if the order is valid, false otherwise.
Usage
// protected - for code of main (parent) or child class $result = $this->is_valid_order_for_request( $order ): bool;
- $order(WC_Order) (required)
- The order object.
Controller::is_valid_order_for_request() Controller::is valid order for request code WC 10.4.3
protected function is_valid_order_for_request( $order ): bool {
return $order instanceof WC_Order && $order->get_id() !== 0 && 'shop_order_refund' !== $order->get_type();
}