pmpro_delete_user

The Paid Memberships Pro pmpro delete user function.

Description

pmpro_delete_user( (constant) $user_id = NULL ); 

Parameters (1)

0. $user_id — Optional. (constant) => NULL
The user id.

Usage

  1. if ( !function_exists( 'pmpro_delete_user' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/cleanup.php'; 
  3.  
  4. // The user id. 
  5. $user_id = NULL; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pmpro_delete_user($user_id); 
  9.  

Defined (1)

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

/includes/cleanup.php  
  1. function pmpro_delete_user($user_id = NULL) 
  2. global $wpdb; 
  3.  
  4. //changing their membership level to 0 will cancel anysubscriptionand remove their membership level entry 
  5. //we don't remove the orders because it would affect reporting 
  6. if(pmpro_changeMembershipLevel(0, $user_id)) 
  7. //okay 
  8. else 
  9. //okay, guessing they didn't have a level