Filter
rpress_availability_unavailable_label
On this page
Filters the label shown for a menu item that is marked unavailable.
Used for the order button text on unavailable menu items and for the Sold Out badge printed over the item thumbnail. The default is 'Sold Out', or the inventory extension's out of stock button text when that setting is not empty. Return a different string to rename the state.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$label | string | The unavailable label. |
$item_id | int | The menu item (post) ID. |
Return value#
string. The label to display.
Example#
function my_unavailable_label( $label, $item_id ) {
return __( 'Back tomorrow', 'my-plugin' );
}
add_filter( 'rpress_availability_unavailable_label', 'my_unavailable_label', 10, 2 );
Notes#
Called from two places. The button path starts from the configured out of stock text if one is set; the badge path always starts from 'Sold Out'. The badge output is escaped by RestroPress.
Source#
Applied in:
includes/admin/fooditems/availability.php(line 115), inrpress_availability_filter_label()includes/admin/fooditems/availability.php(line 188), inrpress_availability_render_soldout_badge()
See also#
Was this page helpful?
