Automattic\WooCommerce\EmailEditor\Engine
Email_Editor::initialize
Initialize the email editor.
Method of the class: Email_Editor{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$Email_Editor = new Email_Editor(); $Email_Editor->initialize(): void;
Email_Editor::initialize() Email Editor::initialize code WC 10.5.0
public function initialize(): void {
$this->logger->info( 'Initializing email editor' );
do_action( 'woocommerce_email_editor_initialized' );
add_filter( 'woocommerce_email_editor_rendering_theme_styles', array( $this, 'extend_email_theme_styles' ), 10, 2 );
$this->register_block_patterns();
$this->register_email_post_types();
$this->register_block_templates();
$this->register_email_post_sent_status();
$this->register_personalization_tags();
$is_editor_page = apply_filters( 'woocommerce_is_email_editor_page', false );
if ( $is_editor_page ) {
$this->extend_email_post_api();
// Initialize the assets manager.
$this->assets_manager->initialize();
}
add_action( 'rest_api_init', array( $this, 'register_email_editor_api_routes' ) );
add_filter( 'woocommerce_email_editor_send_preview_email', array( $this->send_preview_email, 'send_preview_email' ), 11, 1 ); // allow for other filter methods to take precedent.
add_filter( 'single_template', array( $this, 'load_email_preview_template' ) );
add_filter( 'preview_post_link', array( $this, 'update_preview_post_link' ), 10, 2 );
$this->logger->info( 'Email editor initialized successfully' );
}