Filter
rpress_not_available
On this page
Filters the label shown when a menu item is not available.
Runs in the purchase link when rpress_fooditem_available() is false for the menu item. The default is the translated string 'Not Available'.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$label | string | Unavailable label. |
$fooditem_id | int | Menu item ID. |
Return value#
string. Label to show.
Example#
function my_not_available_label( $label, $fooditem_id ) {
return __( 'Sold out', 'my-plugin' );
}
add_filter( 'rpress_not_available', 'my_not_available_label', 10, 2 );
Notes#
Fires from both the list and grid purchase link builders.
Source#
Applied in:
includes/template-functions.php(line 199), inrpress_get_purchase_link()includes/template-functions.php(line 342), inrpress_get_purchase_link_grid()
See also#
Was this page helpful?
