WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

WC_Order_Data_Store_CPT::release_held_coupons() public WC 1.0

Release all coupons held by this order.

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

Хуков нет.

Возвращает

null. Ничего.

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

$WC_Order_Data_Store_CPT = new WC_Order_Data_Store_CPT();
$WC_Order_Data_Store_CPT->release_held_coupons( $order, $save );
$order(WC_Order) (обязательный)
Current order object.
$save(true|false)
Whether to delete keys from DB right away. Could be useful to pass false if you are building a bulk request.

Код WC_Order_Data_Store_CPT::release_held_coupons() WC 5.2.2

<?php
public function release_held_coupons( $order, $save = true ) {
	$coupon_held_keys = $this->get_coupon_held_keys( $order );
	if ( is_array( $coupon_held_keys ) ) {
		foreach ( $coupon_held_keys as $coupon_id => $meta_key ) {
			delete_post_meta( $coupon_id, $meta_key );
		}
	}
	$order->delete_meta_data( '_coupon_held_keys' );

	$coupon_held_keys_for_users = $this->get_coupon_held_keys_for_users( $order );
	if ( is_array( $coupon_held_keys_for_users ) ) {
		foreach ( $coupon_held_keys_for_users as $coupon_id => $meta_key ) {
			delete_post_meta( $coupon_id, $meta_key );
		}
	}
	$order->delete_meta_data( '_coupon_held_keys_for_users' );

	if ( $save ) {
		$order->save_meta_data();
	}

}