Skip to content
Docs
Get RestroPress

Filter

rpress_global_checkout_script_vars

Updated
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#

ParameterTypeDescription
$checkout_varsarrayData 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), in RP_Frontend_Scripts::load_scripts()

See also#

Was this page helpful?