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.

Method of the class: OrderUtil{}

No Hooks.

Return

true|false|WC_Order|WC_Order_Refund. WC_Order object.

Usage

$result = OrderUtil::init_theorder_object( $post_or_order_object );
$post_or_order_object(WC_Order|WP_Post) (required)
Post or order object.

OrderUtil::init_theorder_object() code WC 9.4.2

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