Skip to content
Docs
Get RestroPress

Filter

rpress_customer_recount_sholud_increase_count

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

ParameterTypeDescription
$increaseboolWhether to increment the purchase count. Default true.
$paymentWP_PostThe 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), in RPRESS_Tools_Recount_Customer_Stats::get_data()
  • includes/admin/tools/class-rpress-tools-recount-single-customer-stats.php (line 135), in RPRESS_Tools_Recount_Single_Customer_Stats::process_step()

See also#

Was this page helpful?