Skip to content
Docs
Get RestroPress

Action

rpress_product_details_widget_before_purchase_button

Updated
On this page

Fires before the purchase button in the menu item details widget.

Runs after the menu item title and before the purchase button is printed.

Parameters#

ParameterTypeDescription
$instancearrayThe widget instance settings.
$fooditem_idintID of the menu item shown in the widget.

Example#

function my_details_widget_before_button( $instance, $fooditem_id ) {
	echo '<p class="my-prep-time">' . esc_html( get_post_meta( $fooditem_id, 'my_prep_time', true ) ) . '</p>';
}
add_action( 'rpress_product_details_widget_before_purchase_button', 'my_details_widget_before_button', 10, 2 );

Source#

Fired from:

  • includes/widgets.php (line 249), in RPRESS_Product_Details_Widget::widget()

See also#

Was this page helpful?