membership_is_active

The Membership 2 membership is active function.

Description

membership_is_active( $userdata, $password ); 

Parameters (2)

0. $userdata
The userdata.
1. $password
The password.

Usage

  1. if ( !function_exists( 'membership_is_active' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/app_old/membershipincludes/includes/functions.php'; 
  3.  
  4. // The userdata. 
  5. $userdata = null; 
  6.  
  7. // The password. 
  8. $password = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = membership_is_active($userdata, $password); 
  12.  

Defined (1)

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

/app_old/membershipincludes/includes/functions.php  
  1. function membership_is_active($userdata, $password) { 
  2.  
  3. global $wpdb; 
  4.  
  5. // Checks if this member is an active one. 
  6. if(!empty($userdata) && !is_wp_error($userdata)) { 
  7. $id = $userdata->ID; 
  8.  
  9. if(get_user_meta($id, $wpdb->prefix . 'membership_active', true) == 'no') { 
  10. return new WP_Error('member_inactive', __('Sorry, this account is not active.', 'membership')); 
  11.  
  12.  
  13. return $userdata; 
  14.