Abstract_WC_Order_Data_Store_CPT::update_post_modified_data()publicWC 1.0

Change the modified date of the post to match the order's modified date if passed.

Method of the class: Abstract_WC_Order_Data_Store_CPT{}

No Hooks.


Array. Data with updated modified date.


$Abstract_WC_Order_Data_Store_CPT = new Abstract_WC_Order_Data_Store_CPT();
$Abstract_WC_Order_Data_Store_CPT->update_post_modified_data( $data, $postarr );
$data(array) (required)
An array of slashed, sanitized, and processed post data.
$postarr(array) (required)
An array of sanitized (and slashed) but otherwise unmodified post data.

Abstract_WC_Order_Data_Store_CPT::update_post_modified_data() code WC 7.5.1

public function update_post_modified_data( $data, $postarr ) {
	if ( ! isset( $postarr['order_modified'] ) || ! isset( $postarr['order_modified_gmt'] ) ) {
		return $data;

	$data['post_modified']     = $postarr['order_modified'];
	$data['post_modified_gmt'] = $postarr['order_modified_gmt'];
	return $data;