WooCommerce Code Reference

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

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