Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Payments::is_woopayments_installed │ private │ WC 1.0

Check if the WooPayments plugin is installed.

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

Хуков нет.

Возвращает

bool.

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

// private - только в коде основоного (родительского) класса
$result = $this->is_woopayments_installed(): bool;

Код Payments::is_woopayments_installed() WC 11.3.0

private function is_woopayments_installed(): bool {
	if ( $this->is_woopayments_active() ) {
		// If it is active, it is also installed.
		return true;
	}

	$woopayments_suggestion = $this->get_woopayments_suggestion();
	// We should have the WooPayments suggestion, but if not, return false.
	if ( ! $woopayments_suggestion ) {
		return false;
	}

	// Check if the suggestion has its plugin installed.
	if ( ! empty( $woopayments_suggestion['plugin']['status'] ) &&
		PaymentsProviders::EXTENSION_INSTALLED === $woopayments_suggestion['plugin']['status'] ) {

		return true;
	}

	return false;
}