Action
rpress_fooditem_section_after_description
On this page
Fires between the Description and Pricing sections of the menu item editor.
Lets extensions output a complete section between the two core sections. The markup should be a full rp-fi-section block, using RP_FoodItem_Meta_Boxes::next_section_number() for the heading number.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$post | WP_Post | The menu item being edited. |
Example#
function my_fooditem_extra_section( $post ) {
?>
<div class="rp-fi-section" id="my_extra_section">
<div class="rp-fi-section-header">
<span class="rp-fi-section-number"><?php echo esc_html( RP_FoodItem_Meta_Boxes::next_section_number() ); ?></span>
<?php esc_html_e( 'Preparation', 'my-plugin' ); ?>
</div>
<div class="rp-fi-section-body">
<input type="number" name="my_prep_time" value="<?php echo esc_attr( get_post_meta( $post->ID, 'my_prep_time', true ) ); ?>" class="rp-input">
</div>
</div>
<?php
}
add_action( 'rpress_fooditem_section_after_description', 'my_fooditem_extra_section', 10, 1 );
Notes#
Fields rendered here are not saved automatically; add their names with rpress_metabox_fields_save or save them on rpress_save_fooditem.
Source#
Fired from:
includes/admin/fooditems/views/html-fooditem-data-general.php(line 163)
See also#
Was this page helpful?
