pmpro_translate_billing_period

The Paid Memberships Pro pmpro translate billing period function.

Description

pmpro_translate_billing_period( $period, (int) $number = 1 ); 

Parameters (2)

0. $period
The period.
1. $number — Optional. (int) => 1
The number.

Usage

  1. if ( !function_exists( 'pmpro_translate_billing_period' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/localization.php'; 
  3.  
  4. // The period. 
  5. $period = null; 
  6.  
  7. // The number. 
  8. $number = 1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = pmpro_translate_billing_period($period, $number); 
  12.  

Defined (1)

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

/includes/localization.php  
  1. function pmpro_translate_billing_period($period, $number = 1) 
  2. //note as of v1.8, we stopped using _n and split things up to aid in localization 
  3. if($number == 1) 
  4. if($period == "Day") 
  5. return __("Day", 'paid-memberships-pro' ); 
  6. elseif($period == "Week") 
  7. return __("Week", 'paid-memberships-pro' ); 
  8. elseif($period == "Month") 
  9. return __("Month", 'paid-memberships-pro' ); 
  10. elseif($period == "Year") 
  11. return __("Year", 'paid-memberships-pro' ); 
  12. else 
  13. if($period == "Day") 
  14. return __("Days", 'paid-memberships-pro' ); 
  15. elseif($period == "Week") 
  16. return __("Weeks", 'paid-memberships-pro' ); 
  17. elseif($period == "Month") 
  18. return __("Months", 'paid-memberships-pro' ); 
  19. elseif($period == "Year") 
  20. return __("Years", 'paid-memberships-pro' );