get_ms_account_expire_date

The Membership 2 get ms account expire date function.

Description

get_ms_account_expire_date(); 

Usage

  1. if ( !function_exists( 'get_ms_account_expire_date' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/app/template/template-tags.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_ms_account_expire_date(); 
  7.  

Defined (1)

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

/app/template/template-tags.php  
  1. function get_ms_account_expire_date() { 
  2.  
  3. // These subscriptions have no expire date 
  4. $no_expire_list = array( 
  5. MS_Model_Relationship::STATUS_PENDING,  
  6. MS_Model_Relationship::STATUS_WAITING,  
  7. MS_Model_Relationship::STATUS_DEACTIVATED,  
  8. ); 
  9.  
  10. // These subscriptions display the trial-expire date 
  11. $trial_expire_list = array( 
  12. MS_Model_Relationship::STATUS_TRIAL,  
  13. MS_Model_Relationship::STATUS_TRIAL_EXPIRED,  
  14. ); 
  15.  
  16. if ( in_array( MS_Helper_Template::$ms_account['subscription']->status, $no_expire_list ) ) { 
  17. return ' '; 
  18. } elseif ( in_array( MS_Helper_Template::$ms_account['subscription']->status, $trial_expire_list ) ) { 
  19. return esc_html( 
  20. MS_Helper_Period::format_date( MS_Helper_Template::$ms_account['subscription']->trial_expire_date ) 
  21. ); 
  22. } elseif ( MS_Helper_Template::$ms_account['subscription']->expire_date ) { 
  23. return esc_html( 
  24. MS_Helper_Period::format_date( MS_Helper_Template::$ms_account['subscription']->expire_date ) 
  25. ); 
  26. } else { 
  27. return __( 'Never', 'membership2' );