MS_Rule_ReplaceMenu_ListTable

Membership List Table.

Defined (1)

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

/app/rule/replacemenu/class-ms-rule-replacemenu-listtable.php  
  1. class MS_Rule_ReplaceMenu_ListTable extends MS_Helper_ListTable_RuleMatching { 
  2.  
  3. protected $id = MS_Rule_ReplaceMenu::RULE_ID; 
  4.  
  5. /** 
  6. * Constructor. 
  7. * @since 1.0.0 
  8. * @param MS_Model $model Model for the list data. 
  9. * @param MS_Model_Membership $membership The associated membership. 
  10. */ 
  11. public function __construct( $model ) { 
  12. parent::__construct( $model ); 
  13. $this->name['singular'] = __( 'Menu', 'membership2' ); 
  14. $this->name['plural'] = __( 'Menus', 'membership2' ); 
  15.  
  16. add_filter( 
  17. 'ms_helper_listtable_' . $this->id . '_columns',  
  18. array( $this, 'customize_columns' ) 
  19. ); 
  20.  
  21. $this->editable = self::list_shows_base_items(); 
  22.  
  23. /** 
  24. * Add the Access-column to the list table 
  25. * @since 1.0.0 
  26. */ 
  27. public function customize_columns( $columns ) { 
  28. $columns['access'] = true; 
  29. return $columns; 
  30.  
  31. /** 
  32. * Override the column captions. 
  33. * @since 1.0.0 
  34. * @param string $col 
  35. * @return string 
  36. */ 
  37. protected function get_column_label( $col ) { 
  38. $label = ''; 
  39.  
  40. switch ( $col ) { 
  41. case 'item': $label = __( 'Menu', 'membership2' ); break; 
  42. case 'match': $label = __( 'Replace with this Menu', 'membership2' ); break; 
  43.  
  44. return $label; 
  45.  
  46. /** 
  47. * No pagination for this rule 
  48. * @since 1.0.0 
  49. * @return int 
  50. */ 
  51. protected function get_items_per_page( $option, $default_value = null ) { 
  52. return 0; 
  53.  
  54. /** 
  55. * This rule has no views 
  56. * @since 1.0.0 
  57. * @return array 
  58. */ 
  59. public function get_views() { 
  60. return array(); 
  61.