Automattic\WooCommerce\Utilities

OrderUtil::get_post_or_order_id()public staticWC 1.0

Helper function to id from an post or order object.

Method of the class: OrderUtil{}

No Hooks.

Return

Int. Order or post ID.

Usage

$result = OrderUtil::get_post_or_order_id( $post_or_order_object ) : int;
$post_or_order_object(WP_Post/WC_Order) (required)
WP_Post/WC_Order object to get ID for.

OrderUtil::get_post_or_order_id() code WC 9.0.1

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