Automattic\WooCommerce\Internal\DataStores\Orders

LegacyDataCleanup::can_run │ public │ WC 1.0

Determine whether the cleanup process can be initiated. Legacy data cleanup requires HPOS to be authoritative and compatibility mode to be disabled.

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

Хуков нет.

Возвращает

boolean. TRUE if the cleanup process can be enabled, FALSE otherwise.

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

$LegacyDataCleanup = new LegacyDataCleanup();
$LegacyDataCleanup->can_run();

Код LegacyDataCleanup::can_run() WC 11.2.2

public function can_run() {
	return $this->data_synchronizer->custom_orders_table_is_authoritative() && ! $this->data_synchronizer->data_sync_is_enabled() && ! $this->batch_processing->is_enqueued( get_class( $this->data_synchronizer ) );
}