In this document:
Description
WordPress filter that enables access to the template variables. This allows you to add new Twig variables that can be used in notifications.
Visit our Advanced Twig and Basic Twig guides to get a feel of what can be accomplished with this filter.
Placement
This code should be placed in your custom plugin file.
Source Code
This filter is located in the SSA_Templates::get_template_vars()
function in class-templates.php.
Usage for ssa/templates/get_template_vars Filter
add_filter('ssa/templates/get_template_vars', 'new_function_name', 10, 2);
Parameters
$vars array
The variables of the template.$template
Example – Add Custom Twig Variable
add_filter('ssa/templates/get_template_vars', 'add_custom_var', 10, 2);
function add_custom_var($vars, $template)
{
$vars['new_custom_variable'] = 'My custom variable';
return $vars;
}
Related Guides
-
MemberPress Appointments for Memberships
-
Appointments Tab for Member Dashboards
-
ssa/appointments/customer_information/get_defaults Filter
-
ssa/forms/gravity/should_copy_field_to_ssa Filter