Skip to content
Docs
Get RestroPress

Filter

rpress_not_available

Updated
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#

ParameterTypeDescription
$labelstringUnavailable label.
$fooditem_idintMenu 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), in rpress_get_purchase_link()
  • includes/template-functions.php (line 342), in rpress_get_purchase_link_grid()

See also#

Was this page helpful?