Automattic\WooCommerce\Internal\RestApi\Routes\V4\OrderNotes

Controller::is_valid_order_idprotectedWC 1.0

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_id( $order_id ): bool;
$order_id(mixed) (required)
The order ID.

Controller::is_valid_order_id() code WC 10.4.3

protected function is_valid_order_id( $order_id ): bool {
	$order = $this->get_order_by_id( (int) $order_id );
	return $order && $order instanceof WC_Order;
}