Automattic\WooCommerce\Admin\Composer

Package::init()public staticWC 1.0

Init the package.

Only initialize for WP 5.3 or greater.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = Package::init();

Код Package::init() WC 8.7.0

public static function init() {
	// Avoid double initialization when the feature plugin is in use.
	if (defined( 'WC_ADMIN_VERSION_NUMBER' ) ) {
		self::$active_version = WC_ADMIN_VERSION_NUMBER;
		return;
	}

	$feature_plugin_instance = FeaturePlugin::instance();

	// Indicate to the feature plugin that the core package exists.
	if ( ! defined( 'WC_ADMIN_PACKAGE_EXISTS' ) ) {
		define( 'WC_ADMIN_PACKAGE_EXISTS', true );
	}

	self::$package_active = true;
	self::$active_version = self::VERSION;
	$feature_plugin_instance->init();

	// Unhook the custom Action Scheduler data store class in active older versions of WC Admin.
	remove_filter( 'action_scheduler_store_class', array( $feature_plugin_instance, 'replace_actionscheduler_store_class' ) );
}