pmpro_cancelMembershipLevel

Wrapper for pmpro_changeMembershipLevel to cancel one level.

Description

pmpro_cancelMembershipLevel( $cancel_level, (constant) $user_id = NULL, (string) $old_level_status = 'inactive' ); 

Parameters (3)

0. $cancel_level
The cancel level.
1. $user_id — Optional. (constant) => NULL
The user id.
2. $old_level_status — Optional. (string) => 'inactive'
The old level status.

Usage

  1. if ( !function_exists( 'pmpro_cancelMembershipLevel' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/functions.php'; 
  3.  
  4. // The cancel level. 
  5. $cancel_level = null; 
  6.  
  7. // The user id. 
  8. $user_id = NULL; 
  9.  
  10. // The old level status. 
  11. $old_level_status = 'inactive'; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = pmpro_cancelMembershipLevel($cancel_level, $user_id, $old_level_status); 
  15.  

Defined (1)

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

/includes/functions.php  
  1. function pmpro_cancelMembershipLevel($cancel_level, $user_id = NULL, $old_level_status = 'inactive') { 
  2. return pmpro_changeMembershipLevel(0, $user_id, $old_level_status, $cancel_level); 
  3. }