Automattic\WooCommerce\Internal\Admin\Orders

EditLock::is_locked_by_another_user()publicWC 1.0

Checks whether the order is being edited (i.e. locked) by another user.

Метод класса: EditLock{}

Хуков нет.

Возвращает

true|false. TRUE if order is locked and currently being edited by another user. FALSE otherwise.

Использование

$EditLock = new EditLock();
$EditLock->is_locked_by_another_user( $order ) : bool;
$order(\WC_Order) (обязательный)
Order to check.

Код EditLock::is_locked_by_another_user() WC 9.3.3

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'] );
}