pmpro_discount_code_level

The Paid Memberships Pro pmpro discount code level hook.

Description

apply_filters( 'pmpro_discount_code_level', (unknown) $code_level, (number) $discount_code_id ); 

Parameters (2)

0. $code_level (unknown)
The code level.
1. $discount_code_id (number)
The discount code id.

Usage

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

Defined (3)

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

/services/applydiscountcode.php  
  1. $code_level = apply_filters("pmpro_discount_code_level", $code_level, $discount_code_id); 
/includes/updates/upgrade_1_8_9_3.php  
  1. $pmpro_level = apply_filters( "pmpro_discount_code_level", $pmpro_level, $discount_code_id ); 
/includes/functions.php  
  1. $pmpro_level = apply_filters( "pmpro_discount_code_level", $pmpro_level, $discount_code_id );