Skip to content
Docs
Get RestroPress

Filter

rp_food_addon_column_extra_html

Updated
On this page

Allows extra output next to the price of an add-on item in the menu item popup.

Called inside the quantity/price column of each add-on item. The call is made as a statement and its return value is neither echoed nor used, so a callback has to echo its HTML directly. It is fired once for each add-on price row.

Parameters#

ParameterTypeDescription
$child_addon_idintTerm ID of the add-on item.
$get_addon_pricefloat|stringPrice of the add-on for the current price option.
$addon_idintTerm ID of the add-on group.
$child_addon_slugstringSlug of the add-on item.

Return value#

mixed. Ignored by the caller.

Example#

function my_addon_extra_html( $child_addon_id, $get_addon_price, $addon_id, $child_addon_slug ) {
	echo '<span class="my-addon-id">' . esc_html( $child_addon_id ) . '</span>';
	return $child_addon_id;
}
add_filter( 'rp_food_addon_column_extra_html', 'my_addon_extra_html', 10, 4 );

Notes#

Works like an action: the filtered value is discarded, so output must be echoed.

Source#

Applied in:

  • includes/rp-ajax-functions.php (line 355), in get_fooditem_lists()
  • includes/rp-ajax-functions.php (line 384), in get_fooditem_lists()

See also#

Was this page helpful?