Automattic\WooCommerce\Utilities

OrderUtil::get_order_type()public staticWC 1.0

Returns type pf passed id, post or order object.

Метод класса: OrderUtil{}

Хуков нет.

Возвращает

Строку|null. Type of the order.

Использование

$result = OrderUtil::get_order_type( $order_id );
$order_id(int|WP_Post|WC_Order) (обязательный)
Order ID, post object or order object.

Код OrderUtil::get_order_type() WC 8.7.0

public static function get_order_type( $order_id ) {
	return wc_get_container()->get( COTMigrationUtil::class )->get_order_type( $order_id );
}