pmpro_reports_get_cancellations_sql

Filter query to get cancellation numbers in signups vs cancellations detailed report.

Description

apply_filters( 'pmpro_reports_get_cancellations_sql', (string) $sqlquery, (string) $period, (array(int)) $levels, (array(string)) $status ); 

Parameters (4)

0. $sqlquery (string)
The current SQL
1. $period (string)
Period for report. today, this month, this year, empty string for all time.
2. $levels (array(int))
Level IDs to include in report.
3. $status (array(string))
Statuses to include as cancelled.

Usage

To run the hook, copy the example below.
  1. $sqlquery = apply_filters( 'pmpro_reports_get_cancellations_sql', $sqlquery, $period, $levels, $status ); 
  2.  
  3. if ( !empty( $sqlquery ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the pmpro_reports_get_cancellations_sql callback 
  2. function filter_pmpro_reports_get_cancellations_sql( $sqlquery, $period, $levels, $status ) { 
  3. // make filter magic happen here... 
  4. return $sqlquery
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'pmpro_reports_get_cancellations_sql', 'filter_pmpro_reports_get_cancellations_sql', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'pmpro_reports_get_cancellations_sql', 'filter_pmpro_reports_get_cancellations_sql', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/adminpages/reports/memberships.php  
  1. $sqlQuery = apply_filters('pmpro_reports_get_cancellations_sql', $sqlQuery, $period, $levels, $status);