Skip to content
Docs
Get RestroPress

Filter

rpress_checkout_ux_vars

Updated
On this page

Filters the data localised to the checkout UX script as rpress_checkout_ux.

Passed to wp_localize_script() for the rpress-checkout-ux script. Keys are 'ajaxurl', 'nonce', 'is_checkout', 'state', 'address_fields', 'currency' and 'i18n'. On the checkout page the cart state and required address fields are included; elsewhere they are empty and the script fetches the state itself.

Parameters#

ParameterTypeDescription
$varsarrayScript data.

Return value#

array. Script data.

Example#

add_filter( 'rpress_checkout_ux_vars', 'my_checkout_ux_vars', 10, 1 );
function my_checkout_ux_vars( $vars ) {
	$vars['i18n']['err_phone'] = __( 'We need a phone number to reach you', 'my-plugin' );
	return $vars;
}

Source#

Applied in:

  • includes/features/checkout-ux/hooks.php (line 83), in rpress_checkout_ux_enqueue()
Was this page helpful?