WC_Order_Refund_Data_Store_CPT::read_order_data( WC_Order_Refund $refund, object $post_object )
Read refund data. Can be overridden by child classes to load other props.
Description Description
Parameters Parameters
- $refund
-
(Required) Refund object.
- $post_object
-
(Required) Post object.
Source Source
File: includes/data-stores/class-wc-order-refund-data-store-cpt.php
70 71 72 73 74 75 76 77 78 79 80 81 | protected function read_order_data( & $refund , $post_object ) { parent::read_order_data( $refund , $post_object ); $id = $refund ->get_id(); $refund ->set_props( array ( 'amount' => get_post_meta( $id , '_refund_amount' , true ), 'refunded_by' => metadata_exists( 'post' , $id , '_refunded_by' ) ? get_post_meta( $id , '_refunded_by' , true ) : absint( $post_object ->post_author ), 'refunded_payment' => wc_string_to_bool( get_post_meta( $id , '_refunded_payment' , true ) ), 'reason' => metadata_exists( 'post' , $id , '_refund_reason' ) ? get_post_meta( $id , '_refund_reason' , true ) : $post_object ->post_excerpt, ) ); } |
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |