Automattic\WooCommerce\EmailEditor

Bootstrap{}WC 1.0

Bootstrap class for initializing the Email Editor functionality.

Хуков нет.

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

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

Методы

  1. public __construct(
  2. ERROR: no method name found on line `/**`
  3. ERROR: no method name found on line ``
  4. ERROR: no method name found on line ``
  5. public init()
  6. ERROR: no method name found on line ``
  7. public initialize()
  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. public setup_email_editor_integrations()

Код Bootstrap{} WC 9.9.4

class Bootstrap {

	/**
	 * Email editor instance.
	 *
	 * @var Email_Editor
	 */
	private $email_editor;

	/**
	 * Core email editor integration instance.
	 *
	 * @var CoreEmailEditorIntegration
	 */
	private $core_email_editor_integration;

	/**
	 * Constructor.
	 *
	 * @param Email_Editor               $email_editor Email editor instance.
	 * @param CoreEmailEditorIntegration $core_email_editor_integration  Core email editor integration instance.
	 */
	public function __construct(
		Email_Editor $email_editor,
		CoreEmailEditorIntegration $core_email_editor_integration
	) {
		$this->email_editor                  = $email_editor;
		$this->core_email_editor_integration = $core_email_editor_integration;
	}

	/**
	 * Initialize the email editor functionality.
	 */
	public function init() {
		add_action(
			'init',
			array(
				$this,
				'initialize',
			)
		);

		add_filter(
			'woocommerce_email_editor_initialized',
			array(
				$this,
				'setup_email_editor_integrations',
			)
		);
	}

	/**
	 * Initialize the email editor.
	 */
	public function initialize() {
		$this->email_editor->initialize();
	}

	/**
	 * Setup email editor integrations.
	 */
	public function setup_email_editor_integrations() {
		$this->core_email_editor_integration->initialize();
	}
}