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.

Метод класса: Abstract_WC_Order_Data_Store_CPT{}

Хуков нет.

Возвращает

Массив. 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(массив) (обязательный)
An array of slashed, sanitized, and processed post data.
$postarr(массив) (обязательный)
An array of sanitized (and slashed) but otherwise unmodified post data.

Код Abstract_WC_Order_Data_Store_CPT::update_post_modified_data() WC 8.7.0

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