WC_Order::is_editable PHP Method

is_editable() public method

Checks if an order can be edited, specifically for use on the Edit Order screen.
public is_editable ( ) : boolean
return boolean
    public function is_editable()
    {
        return apply_filters('wc_order_is_editable', in_array($this->get_status(), array('pending', 'on-hold', 'auto-draft')), $this);
    }

Usage Example

示例#1
0
 /**
  * Test: is_editable
  */
 function test_is_editable()
 {
     $object = new WC_Order();
     $object->set_status('pending');
     $this->assertTrue($object->is_editable());
     $object->set_status('processing');
     $this->assertFalse($object->is_editable());
 }
WC_Order