Skip to content
Docs
Get RestroPress

Filter

rpress_add_to_cart_text

Updated
On this page

Filters the label of the add-to-cart button.

Runs when the AJAX add-to-cart link is rendered, that is when AJAX is not disabled. The default label is the translated string 'Add'.

Parameters#

ParameterTypeDescription
$add_to_cart_labelstringButton label.

Return value#

string. Button label.

Example#

function my_add_to_cart_text( $add_to_cart_label ) {
	return __( 'Add to order', 'my-plugin' );
}
add_filter( 'rpress_add_to_cart_text', 'my_add_to_cart_text' );

Notes#

Fires from both the list and grid purchase link builders.

Source#

Applied in:

  • includes/template-functions.php (line 188), in rpress_get_purchase_link()
  • includes/template-functions.php (line 328), in rpress_get_purchase_link_grid()

See also#

Was this page helpful?