membership_record_user_expire

The Membership 2 membership record user expire function.

Description

membership_record_user_expire( $sub_id, $user_id ); 

Parameters (2)

0. $sub_id
The sub id.
1. $user_id
The user id.

Usage

  1. if ( !function_exists( 'membership_record_user_expire' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/app_old/membershipincludes/addons/newsstream.php'; 
  3.  
  4. // The sub id. 
  5. $sub_id = null; 
  6.  
  7. // The user id. 
  8. $user_id = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = membership_record_user_expire($sub_id, $user_id); 
  12.  

Defined (1)

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

/app_old/membershipincludes/addons/newsstream.php  
  1. function membership_record_user_expire($sub_id, $user_id) { 
  2.  
  3. global $wpdb; 
  4.  
  5. $table = membership_db_prefix($wpdb, 'membership_news'); 
  6.  
  7. // Get the information 
  8. $user = new WP_User( $user_id ); 
  9. $sub = new M_Subscription( $sub_id ); 
  10.  
  11. $message = sprintf(__( '<strong>%s</strong> has left subscription <strong>%s</strong>', 'membership' ), $user->display_name, $sub->sub_name() ); 
  12.  
  13. $wpdb->insert( $table, array( 'newsitem' => $message, 'newsdate' => current_time('mysql') ) ); 
  14.