Templates implements Template_Loader
Template loader for vanilla WordPress.
Tags
Interfaces, Classes and Traits
- Template_Loader
Table of Contents
- $default_path : mixed
- $template_path : mixed
- __construct() : mixed
- Constructor.
- get_default_path() : string
- Get the default path (in the plugin).
- get_template() : string
- Retrieves a template.
- get_template_path() : string
- Get the template path (for themes).
- load_template() : mixed
- Load a template.
- load_template_once() : mixed
- Load a template.
- expand_template() : string
- Expands the template if necessary.
Properties
$default_path
private
mixed
$default_path
$template_path
private
mixed
$template_path
Methods
__construct()
Constructor.
public
__construct([string $default_path = '' ]) : mixed
Parameters
- $default_path : string = ''
Return values
mixed —get_default_path()
Get the default path (in the plugin).
public
get_default_path() : string
Return values
string —get_template()
Retrieves a template.
public
get_template(string $template_name[, array<string|int, mixed> $args = [] ]) : string
Parameters
- $template_name : string
- $args : array<string|int, mixed> = []
Return values
string —get_template_path()
Get the template path (for themes).
public
get_template_path() : string
Return values
string —load_template()
Load a template.
public
load_template([string|null $template_name = null ][, array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $template_name : string|null = null
- $args : array<string|int, mixed> = []
Return values
mixed —load_template_once()
Load a template.
public
load_template_once([string|null $template_name = null ][, array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $template_name : string|null = null
- $args : array<string|int, mixed> = []
Return values
mixed —expand_template()
Expands the template if necessary.
private
expand_template(string $template_name) : string
Parameters
- $template_name : string