Filter
rpress_payment_cart_details
On this page
Filters the cart details returned for a payment.
Applied when the cart_details property of an RPRESS_Payment is read. The value is the array of cart items stored with the payment. The filter runs on every read of the property, not only when the payment is loaded.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$cart_details | array | Cart item arrays. |
$payment_id | int | ID of the payment. |
$payment | RPRESS_Payment | The payment object. |
Return value#
array. The cart details to return.
Example#
function my_payment_cart_details( $cart_details, $payment_id, $payment ) {
return is_array( $cart_details ) ? $cart_details : array();
}
add_filter( 'rpress_payment_cart_details', 'my_payment_cart_details', 10, 3 );
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 2154), inRPRESS_Payment::get_cart_details()
See also#
Was this page helpful?
