Skip to content
Docs
Get RestroPress

Filter

rpress_get_bundled_products

Updated
On this page

Filters the IDs of the menu items bundled with a bundle menu item.

Runs at the end of RPRESS_Fooditem::get_bundled_fooditems() after empty entries are removed. The result is cast to an array. The IDs come from the _rpress_bundled_products meta.

Parameters#

ParameterTypeDescription
$bundled_fooditemsarrayBundled menu item IDs.
$IDintID of the bundle menu item.

Return value#

array. The bundled menu item IDs.

Example#

function my_bundled_products( $bundled, $bundle_id ) {
	// Remove a discontinued item from every bundle.
	return array_values( array_diff( $bundled, array( 456 ) ) );
}
add_filter( 'rpress_get_bundled_products', 'my_bundled_products', 10, 2 );

Source#

Applied in:

  • includes/class-rpress-fooditem.php (line 361), in RPRESS_Fooditem::get_bundled_fooditems()

See also#

Was this page helpful?