Properties

$instance

$instance : mixed

Private static variable to hold the single instance of the class.

Type

mixed — Default null.

$template_path

$template_path : string

Template directory.

Type

string — Default empty.

$template_custom_path

$template_custom_path : string

Custom template directory.

Type

string — Default empty.

Methods

get_class_name()

get_class_name() : string

Method get_class_name()

Get Class Name.

Returns

string —

Class name.

instance()

instance() : mixed

Create a new Self Instance.

Returns

mixed —

self::$instance

__construct()

__construct() 

MainWP_Notification_Template constructor.

Run each time the class is called.

get_default_templates_dir()

get_default_templates_dir() : string

Get default templates folder.

Returns

string —

folder.

get_custom_templates_dir()

get_custom_templates_dir() : string

Get custom templates folder.

Returns

string —

folder.

get_template_html()

get_template_html(string  $template_name, array  $args = array()) : string

Get template HTML.

Credits.

Plugin-Name: WooCommerce. Plugin URI: https://woocommerce.com/. Author: Automattic. Author URI: https://woocommerce.com. License: GPLv3 or later.

Parameters

string $template_name

Template name.

array $args

Arguments. (default: array).

Returns

string

get_template()

get_template(string  $template_name, array  $args = array()) : false|string|void

Get templates.

Credits.

Plugin-Name: WooCommerce. Plugin URI: https://woocommerce.com/. Author: Automattic. Author URI: https://woocommerce.com. License: GPLv3 or later.

Parameters

string $template_name

Template name.

array $args

Arguments. (default: array).

Returns

false|string|void

is_overrided_template()

is_overrided_template(string  $type) : boolean

Check if it is overrided template.

Parameters

string $type

Email type.

Returns

boolean —

True|False

get_template_name_by_notification_type()

get_template_name_by_notification_type(string  $type = '') : string|null

Get default template name by email/notification type.

Parameters

string $type

email/notification type.

Returns

string|null —

Template name.

handle_template_file_action()

handle_template_file_action() : boolean

Method handle_template_file_action()

Handle template file action.

Returns

boolean —

$done handle result.

save_template()

save_template(string  $template_code, string  $template) 

Save the email templates.

Credits.

Plugin-Name: WooCommerce. Plugin URI: https://woocommerce.com/. Author: Automattic. Author URI: https://woocommerce.com. License: GPLv3 or later.

Parameters

string $template_code

Template code.

string $template

Template.

locate_template()

locate_template(string  $template_name) : string

Locate a template and return the path for inclusion.

Credits.

Plugin-Name: WooCommerce. Plugin URI: https://woocommerce.com/. Author: Automattic. Author URI: https://woocommerce.com. License: GPLv3 or later.

Parameters

string $template_name

Template name.

Returns

string