Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src/Internal/EmailEdi...
File: Package.php
<?php
[0] Fix | Delete
[1] Fix | Delete
declare( strict_types=1 );
[2] Fix | Delete
[3] Fix | Delete
namespace Automattic\WooCommerce\Internal\EmailEditor;
[4] Fix | Delete
[5] Fix | Delete
defined( 'ABSPATH' ) || exit;
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* This class is used to initialize the email editor package.
[9] Fix | Delete
*
[10] Fix | Delete
* It is a wrapper around the Automattic\WooCommerce\EmailEditor\Package class and
[11] Fix | Delete
* ensures that the email editor package is only initialized if the block editor feature flag is enabled.
[12] Fix | Delete
*/
[13] Fix | Delete
class Package {
[14] Fix | Delete
/**
[15] Fix | Delete
* Version.
[16] Fix | Delete
*
[17] Fix | Delete
* @var string
[18] Fix | Delete
*/
[19] Fix | Delete
const VERSION = \Automattic\WooCommerce\EmailEditor\Package::VERSION;
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Package active.
[23] Fix | Delete
*
[24] Fix | Delete
* @var bool
[25] Fix | Delete
*/
[26] Fix | Delete
private static $package_active = false;
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Init the package.
[30] Fix | Delete
*
[31] Fix | Delete
* @internal
[32] Fix | Delete
*/
[33] Fix | Delete
final public static function init() {
[34] Fix | Delete
self::$package_active = get_option( 'woocommerce_feature_block_email_editor_enabled', 'no' ) === 'yes'; // init is called pretty early. Cant use FeaturesUtil.
[35] Fix | Delete
[36] Fix | Delete
// we only want to initialize the package if the block editor feature flag is enabled.
[37] Fix | Delete
if ( ! self::$package_active ) {
[38] Fix | Delete
return;
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
self::initialize();
[42] Fix | Delete
\Automattic\WooCommerce\EmailEditor\Package::init();
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
/**
[46] Fix | Delete
* Return the version of the package.
[47] Fix | Delete
*
[48] Fix | Delete
* @return string
[49] Fix | Delete
*/
[50] Fix | Delete
public static function get_version() {
[51] Fix | Delete
return \Automattic\WooCommerce\EmailEditor\Package::get_version();
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
/**
[55] Fix | Delete
* Return the path to the package.
[56] Fix | Delete
*
[57] Fix | Delete
* @return string
[58] Fix | Delete
*/
[59] Fix | Delete
public static function get_path() {
[60] Fix | Delete
return \Automattic\WooCommerce\EmailEditor\Package::get_path();
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
/**
[64] Fix | Delete
* Initialize the email editor integration by fetching the class from the container.
[65] Fix | Delete
*
[66] Fix | Delete
* @return void
[67] Fix | Delete
*/
[68] Fix | Delete
public static function initialize() {
[69] Fix | Delete
$container = wc_get_container();
[70] Fix | Delete
$container->get( Integration::class );
[71] Fix | Delete
}
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function