Automattic\WooCommerce\Utilities

OrderUtil::get_post_or_order_id()public staticWC 1.0

Helper function to id from an post or order object.

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

Хуков нет.

Возвращает

int. Order or post ID.

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

$result = OrderUtil::get_post_or_order_id( $post_or_order_object ) : int;
$post_or_order_object(WP_Post/WC_Order) (обязательный)
WP_Post/WC_Order object to get ID for.

Код OrderUtil::get_post_or_order_id() WC 6.9.4

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