Automattic\WooCommerce\EmailEditor\Engine\Templates
Templates::register_templates
Register the templates via register_block_template
Method of the class: Templates{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Templates = new Templates(); $Templates->register_templates( $templates_registry ): Templates_Registry;
- $templates_registry(Templates_Registry) (required)
- The templates registry.
Templates::register_templates() Templates::register templates code WC 10.5.0
public function register_templates( Templates_Registry $templates_registry ): Templates_Registry {
// Register basic blank template.
$general_email_slug = 'email-general';
$template_filename = $general_email_slug . '.html';
$general_email = new Template(
$this->template_prefix,
$general_email_slug,
__( 'General Email', 'woocommerce' ),
__( 'A general template for emails.', 'woocommerce' ),
(string) file_get_contents( $this->template_directory . $template_filename ),
$this->post_types
);
$templates_registry->register( $general_email );
return $templates_registry;
}