Action
rpress_post_add_fee
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#
| Parameter | Type | Description |
|---|---|---|
$fees | array | All fees now stored in the session, keyed by fee ID. |
$key | string | Key of the added fee. |
$args | array | Fee 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), inRPRESS_Fees::add_fee()
See also#
Was this page helpful?
