Automattic\WooCommerce\EmailEditor\Engine\Templates

Templates::initializepublicWC 1.0

Initializes the class.

Метод класса: Templates{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$Templates = new Templates();
$Templates->initialize( $post_types ): void;
$post_types(string[]) (обязательный)
The list of post types registered for usage with email editor.

Код Templates::initialize() WC 10.0.2

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( 'woocommerce_email_editor_register_templates', array( $this, 'register_templates' ) );
	$this->templates_registry->initialize();
	$this->register_post_types_to_api();
}