Skip to content
Docs
Get RestroPress

Filter

rpress_payment_add_fooditem_args

Updated
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#

ParameterTypeDescription
$argsarrayArguments for the menu item being added.
$fooditem_idintID 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), in RPRESS_Payment::add_fooditem()

See also#

Was this page helpful?