MS_Addon_Bbpress_Rule

The Membership 2 MS Addon Bbpress Rule class.

Defined (1)

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

/app/addon/bbpress/rule/class-ms-addon-bbpress-rule.php  
  1. class MS_Addon_Bbpress_Rule extends MS_Controller { 
  2.  
  3. /** 
  4. * The rule ID. 
  5. * @type string 
  6. */ 
  7. const RULE_ID = 'bbpress'; 
  8.  
  9. /** 
  10. * Setup the rule. 
  11. * @since 1.0.0 
  12. */ 
  13. public function prepare_obj() { 
  14. MS_Model_Rule::register_rule( 
  15. self::RULE_ID,  
  16. __CLASS__,  
  17. __( 'bbPress', 'membership2' ),  
  18. 100 
  19. ); 
  20.  
  21. $this->add_filter( 
  22. 'ms_view_protectedcontent_define-' . self::RULE_ID,  
  23. 'handle_render_callback', 10, 2 
  24. ); 
  25.  
  26. /** 
  27. * Tells Membership2 Admin to display this form to manage this rule. 
  28. * @since 1.0.0 
  29. * @param array $callback (Invalid callback) 
  30. * @param array $data The data collection. 
  31. * @return array Correct callback. 
  32. */ 
  33. public function handle_render_callback( $callback, $data ) { 
  34. $view = MS_Factory::load( 'MS_Addon_Bbpress_Rule_View' ); 
  35.  
  36. $view->data = $data; 
  37. $callback = array( $view, 'to_html' ); 
  38.  
  39. return $callback; 
  40.