MS_Rule_Page_ListTable

Membership List Table.

Defined (1)

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

/app/rule/page/class-ms-rule-page-listtable.php  
  1. class MS_Rule_Page_ListTable extends MS_Helper_ListTable_Rule { 
  2.  
  3. protected $id = MS_Rule_Page::RULE_ID; 
  4.  
  5. public function __construct( $model ) { 
  6. parent::__construct( $model ); 
  7. $this->name['singular'] = __( 'Page', 'membership2' ); 
  8. $this->name['plural'] = __( 'Pages', 'membership2' ); 
  9.  
  10. public function get_columns() { 
  11. $columns = array( 
  12. 'cb' => true,  
  13. 'name' => __( 'Page title', 'membership2' ),  
  14. 'access' => true,  
  15. 'dripped' => true,  
  16. ); 
  17.  
  18. return apply_filters( 
  19. "ms_helper_listtable_{$this->id}_columns",  
  20. $columns 
  21. ); 
  22.  
  23. public function column_name( $item ) { 
  24. $actions = array( 
  25. sprintf( 
  26. '<a href="%s" target="_blank">%s</a>',  
  27. get_edit_post_link( $item->id, true ),  
  28. __( 'Edit', 'membership2' ) 
  29. ),  
  30. sprintf( 
  31. '<a href="%s" target="_blank">%s</a>',  
  32. get_permalink( $item->id ),  
  33. __( 'View', 'membership2' ) 
  34. ),  
  35. ); 
  36.  
  37. $actions = apply_filters( 
  38. 'ms_rule_' . $this->id . '_column_actions',  
  39. $actions,  
  40. $item 
  41. ); 
  42.  
  43. return sprintf( 
  44. '%1$s %2$s',  
  45. $item->name,  
  46. $this->row_actions( $actions ) 
  47. ); 
  48.  
  49. public function column_post_date( $item, $column_name ) { 
  50. return $item->post_date; 
  51.  
  52. /** 
  53. * Extra controls to be displayed between bulk actions and pagination 
  54. * @param string $which Either 'top' or 'bottom' 
  55. * @param bool $echo Output or return the HTML code? Default is output. 
  56. */ 
  57. public function extra_tablenav( $which, $echo = true ) { 
  58. if ( 'top' != $which ) { 
  59. return ''; 
  60.  
  61. $filter_button = array( 
  62. 'id' => 'filter_button',  
  63. 'type' => MS_Helper_Html::INPUT_TYPE_SUBMIT,  
  64. 'value' => __( 'Filter', 'membership2' ),  
  65. 'button_type' => 'button',  
  66. ); 
  67.  
  68. if ( ! $echo ) { ob_start(); } 
  69. ?> 
  70. <div class="alignleft actions"> 
  71. <?php 
  72. $this->months_dropdown( 'page' ); 
  73. MS_Helper_Html::html_element( $filter_button ); 
  74. ?> 
  75. </div> 
  76. <?php 
  77. if ( ! $echo ) { return ob_get_clean(); }