Skip to content
Docs
Get RestroPress

Action

rpress_fooditem_options_general_data

Updated
On this page

Fires at the end of the Advanced Settings section of the menu item editor.

Runs after the SKU (when SKUs are enabled) and Admin Notes fields, inside the collapsible Advanced Settings section. Output additional admin-only fields here.

Example#

function my_fooditem_advanced_fields() {
	$value = get_post_meta( get_the_ID(), 'my_internal_code', true );
	echo '<div class="rp-fi-field-group"><label for="my_internal_code">' . esc_html__( 'Internal Code', 'my-plugin' ) . '</label>';
	echo '<input type="text" id="my_internal_code" name="my_internal_code" value="' . esc_attr( $value ) . '" class="rp-input"></div>';
}
add_action( 'rpress_fooditem_options_general_data', 'my_fooditem_advanced_fields' );

Notes#

No arguments are passed. Add the field name via rpress_metabox_fields_save to have it saved.

Source#

Fired from:

  • includes/admin/fooditems/views/html-fooditem-data-general.php (line 278)

See also#

Was this page helpful?