wc_order_is_editable
Filter to check if an order is editable.
Usage
add_filter( 'wc_order_is_editable', 'wp_kama_wc_order_is_editable_filter', 10, 2 );
/**
* Function for `wc_order_is_editable` filter-hook.
*
* @param bool $is_editable Is the order editable.
* @param WC_Order $that Order object.
*
* @return bool
*/
function wp_kama_wc_order_is_editable_filter( $is_editable, $that ){
// filter...
return $is_editable;
}
- $is_editable(true|false)
- Is the order editable.
- $that(WC_Order)
- Order object.
Changelog
| Since 2.7.0 | Introduced. |
Where the hook is called
wc_order_is_editable
woocommerce/includes/class-wc-order.php 1714
return apply_filters( 'wc_order_is_editable', in_array( $this->get_status(), array( OrderStatus::PENDING, OrderStatus::ON_HOLD, OrderStatus::AUTO_DRAFT ), true ), $this );