Skip to content
Docs
Get RestroPress

Action

rpress_post_add_fee

Updated
On this page

Fires after a fee has been added and the fees session value updated.

Runs at the end of RPRESS_Fees::add_fee() after the session has been updated. Use it to react to a new fee, for example to log it or to adjust related cart data. The third argument is the fee arguments before the rpress_fees_add_fee filter was applied.

Parameters#

ParameterTypeDescription
$feesarrayAll fees now stored in the session, keyed by fee ID.
$keystringKey of the added fee.
$argsarrayFee arguments after normalisation, before the rpress_fees_add_fee filter.

Example#

function my_after_fee_added( $fees, $key, $args ) {
	error_log( sprintf( 'Fee %s added: %s', $key, $args['amount'] ) );
}
add_action( 'rpress_post_add_fee', 'my_after_fee_added', 10, 3 );

Source#

Fired from:

  • includes/class-rpress-fees.php (line 103), in RPRESS_Fees::add_fee()

See also#

Was this page helpful?