MS_Addon_Mediafiles

The Membership 2 MS Addon Mediafiles class.

Defined (1)

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

/app/addon/mediafiles/class-ms-addon-mediafiles.php  
  1. class MS_Addon_Mediafiles extends MS_Addon { 
  2.  
  3. /** 
  4. * The Add-on ID 
  5. * @since 1.0.0 
  6. */ 
  7. const ID = 'addon_mediafiles'; 
  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 false; 
  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-on has no real logic. 
  31. // It is only a switch that is used in the MS_Rule_Category files... 
  32.  
  33. $this->add_filter( 
  34. 'ms_model_addon_is_enabled_' . self::ID,  
  35. 'is_enabled' 
  36. ); 
  37.  
  38. /** 
  39. * Registers the Add-On 
  40. * @since 1.0.0 
  41. * @param array $list The Add-Ons list. 
  42. * @return array The updated Add-Ons list. 
  43. */ 
  44. public function register( $list ) { 
  45. // This Add-on is controlled inside the Media Protection Add-on. 
  46. return $list; 
  47.  
  48. /** 
  49. * Add a dependency check to this add-on: It can only be enabled when the 
  50. * parent Add-on "Media" is also enabled. 
  51. * Filter: 'ms_model_addon_is_enabled_addon_mediafiles' 
  52. * @since 1.0.0 
  53. * @internal 
  54. * @param bool $enabled State of this add-on 
  55. * (without considering the parent add-on) 
  56. * @return bool The actual state of this add-on. 
  57. */ 
  58. public function is_enabled( $enabled ) { 
  59. return false; 
  60.