Created
February 2, 2026 06:52
-
-
Save woogist/e916dd081da9af2e4b1e73fa431456cf to your computer and use it in GitHub Desktop.
[WooCommerce Order Status Manager] Allow Order editing for custom statuses
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
| <?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