Filter
rpress_block_storefront_empty_cart_text
On this page
Filters the empty-cart message in the storefront cart panel block.
Runs while the cart panel block renders its empty state paragraph. The message is shown while the cart holds no items. The result is passed through esc_html(), so HTML in the returned string is escaped.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$text | string | The default message, 'Your cart is empty. Add items from the menu to get started.'. |
Return value#
string. Plain-text message to display.
Example#
add_filter( 'rpress_block_storefront_empty_cart_text', 'my_empty_cart_text', 10, 1 );
function my_empty_cart_text( $text ) {
return __( 'Nothing here yet. Pick something tasty from the menu.', 'my-plugin' );
}
Source#
Applied in:
blocks/cart-panel/render.php(line 49)
Was this page helpful?
