Automattic\WooCommerce\EmailEditor\Engine\Templates
Template::__construct
Constructor of the class.
Method of the class: Template{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Template = new Template(); $Template->__construct( $plugin_uri, $slug, $title, $description, $content, $post_types );
- $plugin_uri(string) (required)
- The plugin uri.
- $slug(string) (required)
- The template slug.
- $title(string) (required)
- The template title.
- $description(string) (required)
- The template description.
- $content(string) (required)
- The template content.
- $post_types(string[])
- The list of post types supported by the template.
Default:array()
Template::__construct() Template:: construct code WC 10.7.0
public function __construct(
string $plugin_uri,
string $slug,
string $title,
string $description,
string $content,
array $post_types = array()
) {
$this->plugin_uri = $plugin_uri;
$this->slug = $slug;
$this->name = "{$plugin_uri}//{$slug}"; // The template name is composed from the namespace and the slug.
$this->title = $title;
$this->description = $description;
$this->content = $content;
$this->post_types = $post_types;
}