load_membership_gateways

The Membership 2 load membership gateways function.

Description

load_membership_gateways(); 

Usage

  1. if ( !function_exists( 'load_membership_gateways' ) ) { 
  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_gateways(); 
  7.  

Defined (1)

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

/app_old/membershipincludes/includes/functions.php  
  1. function load_membership_gateways() { 
  2.  
  3. $gateways = get_option('membership_activated_gateways', array()); 
  4.  
  5. if ( is_dir( membership_dir('membershipincludes/gateways') ) ) { 
  6. if ( $dh = opendir( membership_dir('membershipincludes/gateways') ) ) { 
  7. $mem_gateways = array(); 
  8. while ( ( $gateway = readdir( $dh ) ) !== false ) 
  9. if ( substr( $gateway, -4 ) == '.php' ) 
  10. $mem_gateways[] = $gateway; 
  11. closedir( $dh ); 
  12. sort( $mem_gateways ); 
  13.  
  14. $mem_gateways = apply_filters('membership_available_gateways', $mem_gateways); 
  15.  
  16. foreach( $mem_gateways as $mem_gateway ) { 
  17. $check_gateway = str_replace('gateway.', '', str_replace('.php', '', $mem_gateway)); 
  18. if(in_array($check_gateway, $gateways)) { 
  19. include_once( membership_dir('membershipincludes/gateways/' . $mem_gateway) ); 
  20.