Automattic\WooCommerce\Utilities
OrderUtil::is_order()
Checks if passed id, post or order object is a WC_Order object.
Метод класса: OrderUtil{}
Хуков нет.
Возвращает
true|false
. Whether the passed param is an order.
Использование
$result = OrderUtil::is_order( $order_id, $types );
- $order_id(int|WP_Post|WC_Order) (обязательный)
- Order ID, post object or order object.
- $types(string[])
- Types to match against.
По умолчанию: array( foo )
Код OrderUtil::is_order() OrderUtil::is order WC 9.5.1
public static function is_order( $order_id, $types = array( 'shop_order' ) ) { return wc_get_container()->get( COTMigrationUtil::class )->is_order( $order_id, $types ); }