Automattic\WooCommerce\Internal\EmailEditor\EmailTemplates

TemplatesController::register_templates()publicWC 1.0

Register WooCommerce email templates with the template registry.

Method of the class: TemplatesController{}

No Hooks.

Return

Templates_Registry.

Usage

$TemplatesController = new TemplatesController();
$TemplatesController->register_templates( $templates_registry );
$templates_registry(Templates_Registry) (required)
The template registry instance.

TemplatesController::register_templates() code WC 9.8.1

public function register_templates( Templates_Registry $templates_registry ) {
	$templates   = array();
	$templates[] = new WooEmailTemplate();

	foreach ( $templates as $template ) {
		$the_template = new Template(
			$this->template_prefix,
			$template->get_slug(),
			$template->get_title(),
			$template->get_description(),
			$template->get_content(),
			array( Integration::EMAIL_POST_TYPE )
		);
		$templates_registry->register( $the_template );
	}

	return $templates_registry;
}