Created
October 9, 2019 16:23
-
-
Save imfromio/2e8b47ab633dd344d89e623d840c88dc to your computer and use it in GitHub Desktop.
WooCommerce - bulk update order status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = new WC_Order_Query( array( | |
'limit' => -1, | |
'return' => 'ids', | |
) ); | |
$orders = $query->get_orders(); | |
foreach ( $orders as $order_id ) { | |
$order = new WC_Order( $order_id ); | |
if ( ! empty( $order ) ) { | |
$order->update_status( 'processing' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment