Filter
rpress_vegan_options
On this page
Filters the food type options shown in the menu item editor.
Provides the radio options (value to label) for the Food Type field. The default options are an empty value (N/A), veg and non_veg. The selected value is saved in the rpress_food_type meta key.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$vegan_options | array | Associative array of option values to display labels. |
Return value#
array. The options array.
Example#
function my_food_type_options( $options ) {
$options['vegan'] = esc_html__( 'Vegan', 'my-plugin' );
return $options;
}
add_filter( 'rpress_vegan_options', 'my_food_type_options' );
Notes#
Only the editor uses this filter; front-end display of food types is handled elsewhere. The veg and non_veg values get colored styling in the editor.
Source#
Applied in:
includes/admin/fooditems/views/html-fooditem-data-general.php(line 14)
See also#
Was this page helpful?
