Skip to content

Instantly share code, notes, and snippets.

@tamarazuk
Last active February 15, 2016 01:03
Show Gist options
  • Save tamarazuk/3a42f8198ec4d6c66aca to your computer and use it in GitHub Desktop.
Save tamarazuk/3a42f8198ec4d6c66aca to your computer and use it in GitHub Desktop.
WooCommerce Order Status Manager: Allow orders with custom statuses to be edited
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