Skip to content
Docs
Get RestroPress

Filter

rp_addon_category

Updated
On this page

Filters the get_terms() arguments used to load add-on items inside an add-on group.

Applied wherever child terms of an addon_category group are queried: when the menu item popup is built, when add-on items are collected for a menu item, and when the admin order screen loads add-on groups. The default arguments set taxonomy and the parent group; the popup may also add an include list.

Parameters#

ParameterTypeDescription
$addon_category_argsarrayArguments for get_terms().

Return value#

array. The get_terms() arguments.

Example#

function my_addon_category_args( $args ) {
	$args['orderby'] = 'name';
	$args['order']   = 'ASC';
	return $args;
}
add_filter( 'rp_addon_category', 'my_addon_category_args' );

Notes#

The admin order call site also sets fields to ids. The popup call sites pass the result through wp_list_pluck() on term_id, so avoid changing the fields argument.

Source#

Applied in:

  • includes/rp-ajax-functions.php (line 291), in get_fooditem_lists()
  • includes/rp-ajax-functions.php (line 435), in rpress_addon_items_by_fooditem()
  • includes/rp-ajax-functions.php (line 512), in rpress_get_admin_order_addon_groups()

See also#

Was this page helpful?