pmpro_required_billing_fields_stripe_lite

The Paid Memberships Pro pmpro required billing fields stripe lite function.

Description

pmpro_required_billing_fields_stripe_lite( $fields ); 

Parameters (1)

0. $fields
The fields.

Usage

  1. if ( !function_exists( 'pmpro_required_billing_fields_stripe_lite' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/filters.php'; 
  3.  
  4. // The fields. 
  5. $fields = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pmpro_required_billing_fields_stripe_lite($fields); 
  9.  

Defined (1)

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

/includes/filters.php  
  1. function pmpro_required_billing_fields_stripe_lite($fields) 
  2. global $gateway; 
  3.  
  4. //ignore if not using stripe 
  5. if($gateway != "stripe") 
  6. return $fields; 
  7.  
  8. //some fields to remove 
  9. $remove = array('bfirstname', 'blastname', 'baddress1', 'bcity', 'bstate', 'bzipcode', 'bphone', 'bcountry', 'CardType'); 
  10.  
  11. //if a user is logged in, don't require bemail either 
  12. global $current_user; 
  13. if(!empty($current_user->user_email)) 
  14. $remove[] = 'bemail'; 
  15.  
  16. //remove the fields 
  17. foreach($remove as $field) 
  18. unset($fields[$field]); 
  19.  
  20. //ship it! 
  21. return $fields;