Filter
rpress_get_bundled_products
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#
| Parameter | Type | Description |
|---|---|---|
$bundled_fooditems | array | Bundled menu item IDs. |
$ID | int | ID 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), inRPRESS_Fooditem::get_bundled_fooditems()
See also#
Was this page helpful?
