Automattic\WooCommerce\Internal\Admin\Orders
EditLock::is_locked_by_another_user()
Checks whether the order is being edited (i.e. locked) by another user.
Method of the class: EditLock{}
No Hooks.
Return
true|false
. TRUE if order is locked and currently being edited by another user. FALSE otherwise.
Usage
$EditLock = new EditLock(); $EditLock->is_locked_by_another_user( $order ) : bool;
- $order(\WC_Order) (required)
- Order to check.
EditLock::is_locked_by_another_user() EditLock::is locked by another user code WC 9.6.0
public function is_locked_by_another_user( \WC_Order $order ) : bool { $lock = $this->get_lock( $order ); return $lock && ( get_current_user_id() !== $lock['user_id'] ); }