Skip to content
Docs
Get RestroPress

Filter

rp_update_cart

Updated
On this page

Filters the Update Cart button text used by the frontend script.

Runs in RP_Frontend_Scripts::load_scripts() and is localised as the update_cart string of the rp_scripts JavaScript object. The script writes it into the product modal's submit button when a cart item is being edited.

Parameters#

ParameterTypeDescription
$textstringButton text, Update Cart by default.

Return value#

string. The button text.

Example#

function my_update_cart_text( $text ) {
	return __( 'Update order', 'my-textdomain' );
}
add_filter( 'rp_update_cart', 'my_update_cart_text' );

Source#

Applied in:

  • includes/class-rpress-frontend-scripts.php (line 321), in RP_Frontend_Scripts::load_scripts()

See also#

Was this page helpful?