Last active
February 15, 2016 01:03
-
-
Save tamarazuk/3a42f8198ec4d6c66aca to your computer and use it in GitHub Desktop.
WooCommerce Order Status Manager: Allow orders with custom statuses to be edited
This file contains 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
function sv_wc_order_status_manager_order_is_editable( $editable, $order ) { | |
// list the slugs of all order statuses that should be editable. | |
// Note 'pending', 'on-hold', 'auto-draft' are editable by default | |
$editable_custom_statuses = array( 'packaging', 'awaiting-shipment' ); | |
if ( in_array( $order->get_status(), $editable_custom_statuses ) ) { | |
$editable = true; | |
} | |
return $editable; | |
} | |
add_filter( 'wc_order_is_editable', 'sv_wc_order_status_manager_order_is_editable', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment