MailPoet\EmailEditor\Engine\Templates

Templates_Registry::get_by_name()publicWC 1.0

Retrieve a template by its name. Example: get_by_name( 'mailpoet//email-general' ) will return the instance of Template with identical name.

Method of the class: Templates_Registry{}

No Hooks.

Return

Template|null. The template object or null if not found.

Usage

$Templates_Registry = new Templates_Registry();
$Templates_Registry->get_by_name( $name ): ?Template;
$name(string) (required)
The name of the template.

Templates_Registry::get_by_name() code WC 9.8.1

public function get_by_name( string $name ): ?Template {
	return $this->templates[ $name ] ?? null;
}