Abstract_WC_Order_Data_Store_CPT::update_post_modified_data
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.
Returns
Array. Data with updated modified date.
Usage
$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() Abstract WC Order Data Store CPT::update post modified data code WC 10.3.3
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;
}