OrderUtil::is_order()public staticWC 1.0

Checks if passed id, post or order object is a WC_Order object.

Method of the class: OrderUtil{}

No Hooks.


true|false. Whether the passed param is an order.


$result = OrderUtil::is_order( $order_id, $types );
$order_id(int|WP_Post|WC_Order) (required)
Order ID, post object or order object.
Types to match against.
Default: array( foo )

OrderUtil::is_order() code WC 7.1.1

public static function is_order( $order_id, $types = array( 'shop_order' ) ) {
	return wc_get_container()->get( COTMigrationUtil::class )->is_order( $order_id, $types );