Templates implements Template_Loader

Template loader for vanilla WordPress.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

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
Tags

$template_path

private mixed $template_path
Tags

Methods

__construct()

Constructor.

public __construct([string $default_path = '' ]) : mixed
Parameters
$default_path : string = ''
Tags
Return values
mixed

get_default_path()

Get the default path (in the plugin).

public get_default_path() : string
Tags
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> = []
Tags
Return values
string

get_template_path()

Get the template path (for themes).

public get_template_path() : string
Tags
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> = []
Tags
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> = []
Tags
Return values
mixed

expand_template()

Expands the template if necessary.

private expand_template(string $template_name) : string
Parameters
$template_name : string
Tags
Return values
string

Search results