Skip to content

Instantly share code, notes, and snippets.

@woogist
Created February 2, 2026 06:52
Show Gist options
  • Select an option

  • Save woogist/e916dd081da9af2e4b1e73fa431456cf to your computer and use it in GitHub Desktop.

Select an option

Save woogist/e916dd081da9af2e4b1e73fa431456cf to your computer and use it in GitHub Desktop.
[WooCommerce Order Status Manager] Allow Order editing for custom statuses
<?php
/**
* Allow Order editing for custom statuses
*
* @param bool $editable if the order is editable
* @param \WC_order $order
* @return bool if the order is editable for this status
*/
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', 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment