class-template.php
11 months ago
class-templates-registry.php
11 months ago
class-templates.php
4 months ago
email-general.html
7 months ago
index.php
11 months ago
single-email-post-template.php
11 months ago
class-template.php
51 lines
| 1 | <?php |
| 2 | declare(strict_types = 1); |
| 3 | namespace Automattic\WooCommerce\EmailEditor\Engine\Templates; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | class Template { |
| 6 | private string $plugin_uri; |
| 7 | private string $slug; |
| 8 | private string $name; |
| 9 | private string $title; |
| 10 | private string $description; |
| 11 | private string $content; |
| 12 | private array $post_types; |
| 13 | public function __construct( |
| 14 | string $plugin_uri, |
| 15 | string $slug, |
| 16 | string $title, |
| 17 | string $description, |
| 18 | string $content, |
| 19 | array $post_types = array() |
| 20 | ) { |
| 21 | $this->plugin_uri = $plugin_uri; |
| 22 | $this->slug = $slug; |
| 23 | $this->name = "{$plugin_uri}//{$slug}"; // The template name is composed from the namespace and the slug. |
| 24 | $this->title = $title; |
| 25 | $this->description = $description; |
| 26 | $this->content = $content; |
| 27 | $this->post_types = $post_types; |
| 28 | } |
| 29 | public function get_pluginuri(): string { |
| 30 | return $this->plugin_uri; |
| 31 | } |
| 32 | public function get_slug(): string { |
| 33 | return $this->slug; |
| 34 | } |
| 35 | public function get_name(): string { |
| 36 | return $this->name; |
| 37 | } |
| 38 | public function get_title(): string { |
| 39 | return $this->title; |
| 40 | } |
| 41 | public function get_description(): string { |
| 42 | return $this->description; |
| 43 | } |
| 44 | public function get_content(): string { |
| 45 | return $this->content; |
| 46 | } |
| 47 | public function get_post_types(): array { |
| 48 | return $this->post_types; |
| 49 | } |
| 50 | } |
| 51 |