Automattic\WooCommerce\Utilities

OrderUtil::get_post_or_order_id()public staticWC 1.0

Helper function to id from an post or order object.

Метод класса: 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.

Code of OrderUtil::get_post_or_order_id() WC 7.1.0

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 );
}