MailPoet\EmailEditor\Engine\Templates
Templates::initialize()
Initializes the class.
Method of the class: Templates{}
No Hooks.
Return
null
. Nothing (null).
Usage
$Templates = new Templates(); $Templates->initialize( $post_types ): void;
- $post_types(string[]) (required)
- The list of post types registered for usage with email editor.
Templates::initialize() Templates::initialize code WC 9.8.1
public function initialize( array $post_types ): void { $this->post_types = $post_types; add_filter( 'theme_templates', array( $this, 'add_theme_templates' ), 10, 4 ); // Workaround needed when saving post – template association. add_filter( 'mailpoet_email_editor_register_templates', array( $this, 'register_templates' ) ); $this->templates_registry->initialize(); $this->register_post_types_to_api(); }