Filter
rpress_customer_decrease_value
On this page
Filters the amount subtracted from a customer's lifetime value.
Runs in RPRESS_Customer::decrease_value() before the amount is subtracted from the stored purchase_value. The result is floored at zero, so the value never goes negative.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$value | float | The amount to subtract. |
$customer | RPRESS_Customer | The customer object. |
Return value#
float. The amount to subtract from the customer lifetime value.
Example#
function my_customer_decrease_value( $value, $customer ) {
return abs( (float) $value );
}
add_filter( 'rpress_customer_decrease_value', 'my_customer_decrease_value', 10, 2 );
Notes#
Unlike the increase filter, the returned value is not cast with floatval() before use, so return a number.
Source#
Applied in:
includes/class-rpress-customer.php(line 507), inRPRESS_Customer::decrease_value()
See also#
Was this page helpful?
