You can set the date and it will not be overridden. Top ↑. Parameters # Parameters. $postarr. (array|object) ...
$newpostdata['post_date'] = date( 'Y-m-d H:i:s', strtotime($ post_date) );.
I have created a PHP function that calculates how old a WordPress/ WooCommerce order is. If the order is older than 90 days it should be ...
Call wp_update_post() with a special value for 'post_date' and 'post_date_gmt' : $ time = current_time('mysql'); wp_update_post( array ( 'ID' => 123, // ID of the ...
$order = wc_get_order( $order_id );. $args = array(. 'post_id' => $order_id,. // wp_insert_post (called by wp_update_post) will set the date to "now" if ` post_date` ...
Preserve the order dates to not screw with the order statistics.
How to change WooCommerce order's created date. $date=date('Y-m-d H:i:s');
www.thathandsomebeardedguy.com
Dynamically Change Order Date on Status Change
https:// codex.wordpress.org/Function_Reference/wp_update_post
This bug happens with a default WordPress theme active, or Storefront.