1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
<?php
declare( strict_types=1 );
namespace Automattic\WooCommerce\Internal\EmailEditor;
defined( 'ABSPATH' ) || exit;
/** * 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. */ 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 ); } }
|