Skip to content
Docs
Get RestroPress

Filter

rpress_fooditem_data_tabs

Updated
On this page

Filters the list of data tabs defined for the menu item editor.

Builds the tab array (general, category, addons) used by the Menu Item Data meta box, each with a label, target, class list, icon and priority. Tabs are sorted by priority after the filter runs.

Parameters#

ParameterTypeDescription
$tabsarrayAssociative array of tabs keyed by tab slug. Each tab has label, target, class, icon and priority keys.

Return value#

array. The tabs array.

Example#

function my_add_fooditem_tab( $tabs ) {
	$tabs['nutrition'] = array(
		'label'    => esc_html__( 'Nutrition', 'my-plugin' ),
		'target'   => 'nutrition_fooditem_data',
		'class'    => array(),
		'icon'     => 'icon-general',
		'priority' => 40,
	);
	return $tabs;
}
add_filter( 'rpress_fooditem_data_tabs', 'my_add_fooditem_tab' );

Notes#

The editor now uses a single section-based layout, and the private method that applies this filter is not called anywhere in this version, so the filter currently has no effect. Use the rpress_fooditem_section_after_* actions to add content to the editor.

Source#

Applied in:

  • includes/admin/fooditems/class-rp-fooditem-metaboxes.php (line 144), in RP_FoodItem_Meta_Boxes::get_fooditem_data_tabs()

See also#

Was this page helpful?