WordPress at Your Fingertips
function is not described

WC_Order::get_refunds() public WC 2.2

Get order refunds.

{} It's a method of the class: WC_Order{}

No Hooks.

Return

Array. of WC_Order_Refund objects

Usage

$WC_Order = new WC_Order();
$WC_Order->get_refunds();

Changelog

Since 2.2 Introduced.

Code of WC_Order::get_refunds() WC 5.8.0

public function get_refunds() {
	$cache_key   = WC_Cache_Helper::get_cache_prefix( 'orders' ) . 'refunds' . $this->get_id();
	$cached_data = wp_cache_get( $cache_key, $this->cache_group );

	if ( false !== $cached_data ) {
		return $cached_data;
	}

	$this->refunds = wc_get_orders(
		array(
			'type'   => 'shop_order_refund',
			'parent' => $this->get_id(),
			'limit'  => -1,
		)
	);

	wp_cache_set( $cache_key, $this->refunds, $this->cache_group );

	return $this->refunds;
}