Automattic\WooCommerce\Internal\EmailEditor

Package{}WC 1.0

This class is used to initialize the email editor package.

It is a wrapper around the Automattic\WooCommerce\EmailEditor\Package class and ensures that the email editor package is only initialized if the block editor feature flag is enabled.

No Hooks.

Usage

$Package = new Package();
// use class methods

Methods

  1. public static get_version()
  2. public wc_get_container()
  3. public static get_path()
  4. public if ( ! self::$package_active )
  5. public init()
  6. public static initialize()
  7. ERROR: no method name found on line ``
  8. ERROR: no method name found on line ``
  9. ERROR: no method name found on line ``
  10. ERROR: no method name found on line `*/`
  11. ERROR: no method name found on line ``
  12. ERROR: no method name found on line ``
  13. ERROR: no method name found on line `* Return the version of the package.`
  14. ERROR: no method name found on line `/**`
  15. ERROR: no method name found on line ``
  16. ERROR: no method name found on line ``
  17. ERROR: no method name found on line `}`
  18. ERROR: no method name found on line ``
  19. ERROR: no method name found on line `*`
  20. ERROR: no method name found on line `/**`
  21. ERROR: no method name found on line `*/`
  22. ERROR: no method name found on line ``
  23. ERROR: no method name found on line ``
  24. ERROR: no method name found on line ``

Package{} code WC 10.3.3

class Package {
	/**
	 * Version.
	 *
	 * @var string
	 */
	const VERSION = \Automattic\WooCommerce\EmailEditor\Package::VERSION;

	/**
	 * Package active.
	 *
	 * @var bool
	 */
	private static $package_active = false;

	/**
	 * Init the package.
	 *
	 * @internal
	 */
	final public static function init() {
		self::$package_active = get_option( 'woocommerce_feature_block_email_editor_enabled', 'no' ) === 'yes'; // init is called pretty early. Cant use FeaturesUtil.

		// we only want to initialize the package if the block editor feature flag is enabled.
		if ( ! self::$package_active ) {
			return;
		}

		self::initialize();
		\Automattic\WooCommerce\EmailEditor\Package::init();
	}

	/**
	 * Return the version of the package.
	 *
	 * @return string
	 */
	public static function get_version() {
		return \Automattic\WooCommerce\EmailEditor\Package::get_version();
	}

	/**
	 * Return the path to the package.
	 *
	 * @return string
	 */
	public static function get_path() {
		return \Automattic\WooCommerce\EmailEditor\Package::get_path();
	}

	/**
	 * Initialize the email editor integration by fetching the class from the container.
	 *
	 * @return void
	 */
	public static function initialize() {
		$container = wc_get_container();
		$container->get( Integration::class );
	}
}