Skip to content
Docs
Get RestroPress

Action

rpress_fooditem_decrease_earnings

Updated
On this page

Fires after the earnings total of a menu item has been decreased.

Runs in RPRESS_Fooditem::decrease_earnings() after the _rpress_fooditem_earnings meta has been updated. It does not fire when current earnings are zero or the update fails.

Parameters#

ParameterTypeDescription
$fooditem_idintMenu item ID.
$earningsfloatNew total earnings.
$fooditemRPRESS_FooditemThe menu item object.

Example#

function my_after_earnings_decrease( $fooditem_id, $earnings, $fooditem ) {
	update_post_meta( $fooditem_id, '_my_last_earnings_check', $earnings );
}
add_action( 'rpress_fooditem_decrease_earnings', 'my_after_earnings_decrease', 10, 3 );

Source#

Fired from:

  • includes/class-rpress-fooditem.php (line 533), in RPRESS_Fooditem::decrease_earnings()

See also#

Was this page helpful?