WC_Order::get_refunds()
Get order refunds.
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. |
WC_Order::get_refunds() WC Order::get refunds code WC 9.6.1
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; }