Filter
rpress_customer_recount_sholud_increase_count
On this page
Filters whether a payment is added to the customer's recalculated order count.
Runs for each payment during a customer stats recalculation, after rpress_customer_recount_should_process_payment. The default is true. Returning false leaves the payment out of the customer's purchase count.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$increase | bool | Whether to increment the purchase count. Default true. |
$payment | WP_Post | The payment post being evaluated. |
Return value#
bool. True to count the payment.
Example#
function my_recount_increase_count( $increase, $payment ) {
if ( 'revoked' === $payment->post_status ) {
return false;
}
return $increase;
}
add_filter( 'rpress_customer_recount_sholud_increase_count', 'my_recount_increase_count', 10, 2 );
Notes#
The hook name contains a typo (sholud) and must be used exactly as written. Fired from RPRESS_Tools_Recount_Customer_Stats (get_data) and RPRESS_Tools_Recount_Single_Customer_Stats (process_step).
Source#
Applied in:
includes/admin/tools/class-rpress-tools-recount-customer-stats.php(line 89), inRPRESS_Tools_Recount_Customer_Stats::get_data()includes/admin/tools/class-rpress-tools-recount-single-customer-stats.php(line 135), inRPRESS_Tools_Recount_Single_Customer_Stats::process_step()
See also#
Was this page helpful?
