MS_Addon_Automessage

The Membership 2 MS Addon Automessage class.

Defined (1)

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

/app/addon/automessage/class-ms-addon-automessage.php  
  1. class MS_Addon_Automessage extends MS_Addon { 
  2.  
  3. /** 
  4. * The Add-on ID 
  5. * @since 1.0.0 
  6. */ 
  7. const ID = 'addon_automessage'; 
  8.  
  9. /** 
  10. * Checks if the current Add-on is enabled 
  11. * @since 1.0.0 
  12. * @return bool 
  13. */ 
  14. static public function is_active() { 
  15. return MS_Model_Addon::is_enabled( self::ID ); 
  16.  
  17. /** 
  18. * Returns the Add-on ID (self::ID). 
  19. * @since 1.0.1.0 
  20. * @return string 
  21. */ 
  22. public function get_id() { 
  23. return self::ID; 
  24.  
  25. /** 
  26. * Initializes the Add-on. Always executed. 
  27. * @since 1.0.0 
  28. */ 
  29. public function init() { 
  30. $this->add_filter( 'automessage_custom_user_hooks', 'automessage_custom_user_hooks' ); 
  31.  
  32. /** 
  33. * Registers the Add-On 
  34. * @since 1.0.0 
  35. * @param array $list The Add-Ons list. 
  36. * @return array The updated Add-Ons list. 
  37. */ 
  38. public function register( $list ) { 
  39. /** 
  40. // Don't register: Not completed yet... 
  41.   
  42. $list[ self::ID ] = (object) array( 
  43. 'name' => __( 'Automessage', 'membership2' ),  
  44. 'description' => __( 'Automessage integration.', 'membership2' ),  
  45. ); 
  46. */ 
  47. return $list; 
  48.  
  49. /** 
  50. * wpmu.dev Automessage plugin integration. 
  51. * @since 1.0.0 
  52. * @access public 
  53. * @param array $hooks The existing hooks. 
  54. * @return array The modified array of hooks. 
  55. */ 
  56. public function automessage_custom_user_hooks( $hooks ) { 
  57. $comm_types = MS_Model_Communication::get_communication_type_titles(); 
  58.  
  59. foreach ( $comm_types as $type => $desc ) { 
  60. $action = "ms_communications_process_$type"; 
  61. $hooks[ $action ] = array( 'action_nicename' => $desc ); 
  62.  
  63. return $hooks; 
  64.