WC_Order::get_refunds()
Get order refunds.
Description Description
Return Return
(array) of WC_Order_Refund objects
Source Source
File: includes/class-wc-order.php
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;
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.2 | Introduced. |