Automattic\WooCommerce\Internal\Admin

FeaturePlugin::init()publicWC 1.0

Init the feature plugin, only if we can detect both Gutenberg and WooCommerce.

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

No Hooks.

Return

null. Nothing.

Usage

$FeaturePlugin = new FeaturePlugin();
$FeaturePlugin->init();

Code of FeaturePlugin::init() WC 7.1.0

public function init() {
	// Bail if WC isn't initialized (This can be called from WCAdmin's entrypoint).
	if ( ! defined( 'WC_ABSPATH' ) ) {
		return;
	}

	// Load the page controller functions file first to prevent fatal errors when disabling WooCommerce Admin.
	$this->define_constants();
	require_once WC_ADMIN_ABSPATH . '/includes/react-admin/page-controller-functions.php';
	require_once WC_ADMIN_ABSPATH . '/src/Admin/Notes/DeprecatedNotes.php';
	require_once WC_ADMIN_ABSPATH . '/includes/react-admin/core-functions.php';
	require_once WC_ADMIN_ABSPATH . '/includes/react-admin/feature-config.php';
	require_once WC_ADMIN_ABSPATH . '/includes/react-admin/wc-admin-update-functions.php';
	require_once WC_ADMIN_ABSPATH . '/includes/react-admin/class-experimental-abtest.php';

	if ( did_action( 'plugins_loaded' ) ) {
		self::on_plugins_loaded();
	} else {
		// Make sure we hook into `plugins_loaded` before core's Automattic\WooCommerce\Package::init().
		// If core is network activated but we aren't, the packaged version of WooCommerce Admin will
		// attempt to use a data store that hasn't been loaded yet - because we've defined our constants here.
		// See: https://github.com/woocommerce/woocommerce-admin/issues/3869.
		add_action( 'plugins_loaded', array( $this, 'on_plugins_loaded' ), 9 );
	}
}