Skip to content
Docs
Get RestroPress

Filter

rpress_addon_types

Updated
On this page

Filters the available add-on group selection types.

Runs in rpress_get_addon_types and is applied twice: first to the default array, then again to the result. The defaults are single and multiple, keyed by slug with untranslated labels. The list is used by the form that creates an add-on group.

Parameters#

ParameterTypeDescription
$addon_typesarraySelection types keyed by slug with display labels as values.

Return value#

array. The add-on selection types.

Example#

function my_addon_types( $addon_types ) {
	$addon_types['multiple'] = __( 'Multiple', 'my-plugin' );
	return $addon_types;
}
add_filter( 'rpress_addon_types', 'my_addon_types', 10, 1 );

Notes#

The filter is applied twice in the same function, so callbacks run twice per call and must be idempotent.

Source#

Applied in:

  • includes/fooditem-functions.php (line 781), in rpress_get_addon_types()
  • includes/fooditem-functions.php (line 788), in rpress_get_addon_types()

See also#

Was this page helpful?