WordPress at Your Fingertips
function is not described

WC_Order_Refund_Data_Store_CPT::read_order_data() protected WC 3.0.0

Read refund data. Can be overridden by child classes to load other props.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->read_order_data( $refund, $post_object );
$refund(WC_Order_Refund) (required) (passed by reference — &)
Refund object.
$post_object(object) (required)
Post object.

Changelog

Since 3.0.0 Introduced.

Code of WC_Order_Refund_Data_Store_CPT::read_order_data() WC 5.8.0

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,
		)
	);
}