Filter
rpress_payment_add_fooditem_args
On this page
Filters the arguments used when adding a menu item to an existing payment.
Applied in RPRESS_Payment::add_fooditem to the caller-supplied arguments before they are merged with the defaults (quantity 1, price_id false, item_price false, discount 0, tax 0.00, fees empty).
Parameters#
| Parameter | Type | Description |
|---|---|---|
$args | array | Arguments for the menu item being added. |
$fooditem_id | int | ID of the menu item being added. |
Return value#
array. The arguments for the menu item.
Example#
function my_add_fooditem_args( $args, $fooditem_id ) {
if ( empty( $args['quantity'] ) ) {
$args['quantity'] = 1;
}
return $args;
}
add_filter( 'rpress_payment_add_fooditem_args', 'my_add_fooditem_args', 10, 2 );
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 964), inRPRESS_Payment::add_fooditem()
See also#
Was this page helpful?
