MS_Rule_Url_ListTable

Membership List Table.

Defined (1)

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

/app/rule/url/class-ms-rule-url-listtable.php  
  1. class MS_Rule_Url_ListTable extends MS_Helper_ListTable_Rule { 
  2.  
  3. protected $id = MS_Rule_Url::RULE_ID; 
  4.  
  5. public function __construct( $model ) { 
  6. parent::__construct( $model ); 
  7. $this->name['singular'] = __( 'URL', 'membership2' ); 
  8. $this->name['plural'] = __( 'URLs', 'membership2' ); 
  9. $this->name['default_access'] = __( 'Nobody', 'membership2' ); 
  10.  
  11. public function get_columns() { 
  12. return apply_filters( 
  13. 'membership_helper_listtable_' . $this->id . '_columns',  
  14. array( 
  15. 'cb' => true,  
  16. 'url' => __( 'Page URL', 'membership2' ),  
  17. 'access' => true,  
  18. ); 
  19.  
  20. public function column_url( $item ) { 
  21. $rule_url = esc_url_raw( 
  22. add_query_arg( array( 'item' => $item->id ) ) 
  23. ); 
  24.  
  25. $actions = array(); 
  26.  
  27. if ( $this->list_shows_base_items() ) { 
  28. $trash_url = esc_url_raw( 
  29. add_query_arg( 
  30. array( 
  31. 'rule_action' => MS_Rule_Url::ACTION_DELETE,  
  32. '_wpnonce' => wp_create_nonce( MS_Rule_Url::ACTION_DELETE ),  
  33. ),  
  34. $rule_url 
  35. ); 
  36.  
  37. $actions['trash'] = sprintf( 
  38. '<a href="%s">%s</a>',  
  39. $trash_url,  
  40. __( 'Delete', 'membership2' ) 
  41. ); 
  42.  
  43. $actions = apply_filters( 
  44. 'ms_rule_' . $this->id . '_column_actions',  
  45. $actions,  
  46. $item 
  47. ); 
  48.  
  49. return sprintf( 
  50. '%1$s %2$s',  
  51. $item->url,  
  52. $this->row_actions( $actions ) 
  53. ); 
  54.  
  55. /** 
  56. * Remove the view-filters for this rule. 
  57. * @since 1.0.0 
  58. */ 
  59. public function get_views() { 
  60. return array(); 
  61.  
  62. /** 
  63. * Remove the list-header (with the rule title) for this rule 
  64. * @since 1.0.0 
  65. */ 
  66. public function list_head() { 
  67.