/app/addon/buddypress/rule/class-ms-addon-buddypress-rule-listtable.php

  1. <?php 
  2. /** 
  3. * Membership List Table 
  4. * 
  5. * @since 1.0.0 
  6. */ 
  7. class MS_Addon_BuddyPress_Rule_ListTable extends MS_Helper_ListTable_Rule { 
  8.  
  9. /** 
  10. * List-ID is only used to generate the list HTML code. 
  11. * 
  12. * @var string 
  13. */ 
  14. protected $id = 'rule_buddypress'; 
  15.  
  16. /** 
  17. * Define available columns 
  18. * 
  19. * @since 1.0.0 
  20. * @return array 
  21. */ 
  22. public function get_columns() { 
  23. return apply_filters( 
  24. 'ms_helper_listtable_' . $this->id . '_columns',  
  25. array( 
  26. 'cb' => true,  
  27. 'name' => __( 'Type', 'membership2' ),  
  28. 'access' => true,  
  29. ); 
  30.  
  31. /** 
  32. * Return list of sortable columns. 
  33. * 
  34. * @since 1.0.0 
  35. * @return array 
  36. */ 
  37. public function get_sortable_columns() { 
  38. return array(); 
  39.  
  40. /** 
  41. * Render the contents of the "name" column. 
  42. * 
  43. * @since 1.0.0 
  44. * @param object $item Item that is displayed, provided by the model. 
  45. * @return string The HTML code. 
  46. */ 
  47. public function column_name( $item ) { 
  48. $html = sprintf( 
  49. '<div>%1$s</div><div>%2$s</div>',  
  50. esc_html( $item->name ),  
  51. esc_html( $item->description ) 
  52. ); 
  53.  
  54. return $html; 
  55.  
  56. /** 
  57. * Do not display a Title above the list. 
  58. * 
  59. * @since 1.0.0 
  60. */ 
  61. public function list_head() { 
  62.  
  63. /** 
  64. * Do not display a status-filter for this rule. 
  65. * 
  66. * @since 1.0.0 
  67. * @return array 
  68. */ 
  69. public function get_views() { 
  70. return array(); 
  71.  
.