Skip to content
Docs
Get RestroPress

Action

rpress_fooditem_increase_earnings

Updated
On this page

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

Runs in RPRESS_Fooditem::increase_earnings() after the _rpress_fooditem_earnings meta has been updated. It does not fire when the update fails.

Parameters#

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

Example#

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

Source#

Fired from:

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

See also#

Was this page helpful?