Automattic\WooCommerce\Internal\EmailEditor\EmailTemplates
TemplatesController::register_templates
Register WooCommerce email templates with the template registry.
Method of the class: TemplatesController{}
No Hooks.
Returns
Templates_Registry.
Usage
$TemplatesController = new TemplatesController(); $TemplatesController->register_templates( $templates_registry );
- $templates_registry(Templates_Registry) (required)
- The template registry instance.
TemplatesController::register_templates() TemplatesController::register templates code WC 10.6.2
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;
}