Template
in package
The class represents a template
Table of Contents
- $content : string
- The template content.
- $description : string
- The template description.
- $name : string
- The template name used for block template registration.
- $plugin_uri : string
- Plugin uri used in the template name.
- $post_types : array<string|int, mixed>
- The list of supoorted post types.
- $slug : string
- The template slug used in the template name.
- $title : string
- The template title.
- __construct() : mixed
- Constructor of the class.
- get_content() : string
- Get the template content.
- get_description() : string
- Get the template description.
- get_name() : string
- Get the template name composed from the plugin_uri and the slug.
- get_pluginuri() : string
- Get the plugin uri.
- get_post_types() : array<string|int, string>
- Get the list of supported post types.
- get_slug() : string
- Get the template slug.
- get_title() : string
- Get the template title.
Properties
$content
The template content.
private
string
$content
$description
The template description.
private
string
$description
$name
The template name used for block template registration.
private
string
$name
$plugin_uri
Plugin uri used in the template name.
private
string
$plugin_uri
$post_types
The list of supoorted post types.
private
array<string|int, mixed>
$post_types
$slug
The template slug used in the template name.
private
string
$slug
$title
The template title.
private
string
$title
Methods
__construct()
Constructor of the class.
public
__construct(string $plugin_uri, string $slug, string $title, string $description, string $content[, array<string|int, string> $post_types = array() ]) : mixed
Parameters
- $plugin_uri : string
-
The plugin uri.
- $slug : string
-
The template slug.
- $title : string
-
The template title.
- $description : string
-
The template description.
- $content : string
-
The template content.
- $post_types : array<string|int, string> = array()
-
The list of post types supported by the template.
Return values
mixed —get_content()
Get the template content.
public
get_content() : string
Return values
string —get_description()
Get the template description.
public
get_description() : string
Return values
string —get_name()
Get the template name composed from the plugin_uri and the slug.
public
get_name() : string
Return values
string —get_pluginuri()
Get the plugin uri.
public
get_pluginuri() : string
Return values
string —get_post_types()
Get the list of supported post types.
public
get_post_types() : array<string|int, string>
Return values
array<string|int, string> —get_slug()
Get the template slug.
public
get_slug() : string
Return values
string —get_title()
Get the template title.
public
get_title() : string