Filter
rpress_allowed_cart_item_modifications
On this page
Filters the cart item keys that RPRESS_Payment::modify_cart_item may change.
Any key in the arguments passed to modify_cart_item that is not in this list is dropped. The default list is item_price, tax, discount, quantity and instruction.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$allowed_items | string[] | Cart item keys that may be modified. |
Return value#
string[]. The allowed keys.
Example#
function my_allowed_cart_item_mods( $allowed_items ) {
$allowed_items[] = 'my_custom_key';
return $allowed_items;
}
add_filter( 'rpress_allowed_cart_item_modifications', 'my_allowed_cart_item_mods' );
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 1205), inRPRESS_Payment::modify_cart_item()
See also#
Was this page helpful?
