Automattic\WooCommerce\Admin\Marketing

InstalledExtensions::get_mailpoet_extension_data()protected staticWC 1.0

Get MailPoet extension data.

{} Это метод класса: InstalledExtensions{}

Хуков нет.

Возвращает

Массив|true|false.

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

$result = InstalledExtensions::get_mailpoet_extension_data();

Код InstalledExtensions::get_mailpoet_extension_data() WC 6.4.1

protected static function get_mailpoet_extension_data() {
	$slug = 'mailpoet';

	if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
		return false;
	}

	$data         = self::get_extension_base_data( $slug );
	$data['icon'] = plugins_url( 'images/marketing/mailpoet.svg', WC_ADMIN_PLUGIN_FILE );

	if ( 'activated' === $data['status'] && class_exists( '\MailPoet\API\API' ) ) {
		$mailpoet_api = \MailPoet\API\API::MP( 'v1' );

		if ( ! method_exists( $mailpoet_api, 'isSetupComplete' ) || $mailpoet_api->isSetupComplete() ) {
			$data['status']      = 'configured';
			$data['settingsUrl'] = admin_url( 'admin.php?page=mailpoet-settings' );
		} else {
			$data['settingsUrl'] = admin_url( 'admin.php?page=mailpoet-newsletters' );
		}

		$data['docsUrl']    = 'https://kb.mailpoet.com/';
		$data['supportUrl'] = 'https://www.mailpoet.com/support/';
	}

	return $data;
}