load_membership_addons

The Membership 2 load membership addons function.

Description

load_membership_addons(); 

Usage

  1. if ( !function_exists( 'load_membership_addons' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/app_old/membershipincludes/includes/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = load_membership_addons(); 
  7.  

Defined (1)

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

/app_old/membershipincludes/includes/functions.php  
  1. function load_membership_addons() { 
  2.  
  3. $addons = get_option('membership_activated_addons', array()); 
  4.  
  5. if ( is_dir( membership_dir('membershipincludes/addons') ) ) { 
  6. if ( $dh = opendir( membership_dir('membershipincludes/addons') ) ) { 
  7. $mem_addons = array(); 
  8. while ( ( $addon = readdir( $dh ) ) !== false ) 
  9. if ( substr( $addon, -4 ) == '.php' ) 
  10. $mem_addons[] = $addon; 
  11. closedir( $dh ); 
  12. sort( $mem_addons ); 
  13.  
  14. $mem_addons = apply_filters('membership_available_addons', $mem_addons); 
  15.  
  16. foreach( $mem_addons as $mem_addon ) { 
  17. if(in_array($mem_addon, $addons)) { 
  18. include_once( membership_dir('membershipincludes/addons/' . $mem_addon) ); 
  19.