Filter
rpress_block_storefront_price_text
On this page
Filters the plain-text menu price shown by the block storefront.
Applied to the formatted price of a single-price menu item after tax display rules are applied. Not applied to variable-price items, which show a price range. The default is the currency-formatted price decoded to plain text.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$text | string | Formatted price as plain text. |
$fooditem_id | int | Menu item (fooditem) ID. |
$price | float | Numeric price after tax adjustment. |
Return value#
string. Price text.
Example#
add_filter( 'rpress_block_storefront_price_text', 'my_storefront_price_text', 10, 3 );
function my_storefront_price_text( $text, $fooditem_id, $price ) {
return $price <= 0 ? __( 'Free', 'my-plugin' ) : $text;
}
Source#
Applied in:
includes/features/block-storefront/functions.php(line 129), inrpress_block_storefront_price_text()
Was this page helpful?
