M_Roles_leftsub

The Membership 2 M Roles leftsub function.

Description

M_Roles_leftsub( $fromsub_id, $fromlevel_id, $user_id ); 

Parameters (3)

0. $fromsub_id
The fromsub id.
1. $fromlevel_id
The fromlevel id.
2. $user_id
The user id.

Usage

  1. if ( !function_exists( 'M_Roles_leftsub' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/app_old/membershipincludes/addons/integrated.wproles.php'; 
  3.  
  4. // The fromsub id. 
  5. $fromsub_id = null; 
  6.  
  7. // The fromlevel id. 
  8. $fromlevel_id = null; 
  9.  
  10. // The user id. 
  11. $user_id = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = M_Roles_leftsub($fromsub_id, $fromlevel_id, $user_id); 
  15.  

Defined (1)

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

/app_old/membershipincludes/addons/integrated.wproles.php  
  1. function M_Roles_leftsub( $fromsub_id, $fromlevel_id, $user_id ) { 
  2.  
  3. M_Roles_leftlevel( $fromlevel_id, $user_id ); 
  4.  
  5. $member = new M_Membership( $user_id ); 
  6. if(!$member->has_levels()) { 
  7. if(method_exists($member, 'has_cap') && !$member->has_cap('activate_plugins')) { 
  8. $member->set_role( get_option('default_role') ); 
  9.