Filter
rpress_global_checkout_script_vars
On this page
Filters the data localised to the checkout script.
Runs in RP_Frontend_Scripts::load_scripts() before the array is localised to the rp-checkout script as the rpress_global_vars JavaScript object. It holds the AJAX URL, nonces, validation messages and a few settings such as whether taxes are enabled.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$checkout_vars | array | Data for the rpress_global_vars JavaScript object. |
Return value#
array. The data for the rpress_global_vars object.
Example#
function my_global_checkout_vars( $vars ) {
$vars['my_message'] = __( 'Thanks for ordering', 'my-textdomain' );
return $vars;
}
add_filter( 'rpress_global_checkout_script_vars', 'my_global_checkout_vars' );
Source#
Applied in:
includes/class-rpress-frontend-scripts.php(line 426), inRP_Frontend_Scripts::load_scripts()
See also#
Was this page helpful?
