MS_Rule_Post_View

The Membership 2 MS Rule Post View class.

Defined (1)

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

/app/rule/post/class-ms-rule-post-view.php  
  1. class MS_Rule_Post_View extends MS_View { 
  2.  
  3. public function to_html() { 
  4. $membership = MS_Model_Membership::get_base(); 
  5. $rule = $membership->get_rule( MS_Rule_Post::RULE_ID ); 
  6. $rule_listtable = new MS_Rule_Post_ListTable( $rule ); 
  7. $rule_listtable->prepare_items(); 
  8.  
  9. $header_data = apply_filters( 
  10. 'ms_view_membership_protectedcontent_header',  
  11. array( 
  12. 'title' => __( 'Choose Posts you want to protect', 'membership2' ),  
  13. 'desc' => '',  
  14. ),  
  15. MS_Rule_Post::RULE_ID,  
  16. $this 
  17. ); 
  18.  
  19. ob_start(); 
  20. ?> 
  21. <div class="ms-settings"> 
  22. <?php 
  23. MS_Helper_Html::settings_tab_header( $header_data ); 
  24.  
  25. $rule_listtable->views(); 
  26. $rule_listtable->search_box( __( 'Posts', 'membership2' ) ); 
  27. ?> 
  28. <form action="" method="post"> 
  29. <?php 
  30. $rule_listtable->display(); 
  31.  
  32. do_action( 
  33. 'ms_view_membership_protectedcontent_footer',  
  34. MS_Rule_Post::RULE_ID,  
  35. $this 
  36. ); 
  37. ?> 
  38. </form> 
  39. </div> 
  40. <?php 
  41.  
  42. MS_Helper_Html::settings_footer(); 
  43. return ob_get_clean(); 
  44.