Automattic\WooCommerce\Utilities

OrderUtil::init_theorder_object()public staticWC 1.0

Helper function to initialize the global $theorder object, mostly used during order meta boxes rendering.

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

Хуков нет.

Возвращает

WC_Order. WC_Order object.

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

$result = OrderUtil::init_theorder_object( $post_or_order_object ) : WC_Order;
$post_or_order_object(WC_Order|WP_Post) (обязательный)
Post or order object.

Код OrderUtil::init_theorder_object() WC 6.9.4

public static function init_theorder_object( $post_or_order_object ) : WC_Order {
	return wc_get_container()->get( COTMigrationUtil::class )->init_theorder_object( $post_or_order_object );
}