Action
rpress_product_details_widget_update
On this page
Fires while the menu item details widget settings are being saved.
Runs in the widget update() method after the standard fields have been sanitized and before the fooditem_id is removed for the "current menu item" display type.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$instance | array | The sanitized instance settings about to be saved. |
Example#
function my_details_widget_update( $instance ) {
if ( isset( $instance['fooditem_id'] ) ) {
update_option( 'my_last_widget_fooditem', absint( $instance['fooditem_id'] ) );
}
}
add_action( 'rpress_product_details_widget_update', 'my_details_widget_update', 10, 1 );
Notes#
The array is passed by value, so changes made in a callback are not saved with the widget.
Source#
Fired from:
includes/widgets.php(line 412), inRPRESS_Product_Details_Widget::update()
See also#
Was this page helpful?
