1 | <?php namespace EmailLog\Core\UI\ListTable; |
||
12 | class LogListTable extends \WP_List_Table { |
||
13 | /** |
||
14 | * @var object The page where this table is rendered. |
||
15 | * |
||
16 | * @since 2.0 |
||
17 | */ |
||
18 | protected $page; |
||
19 | |||
20 | /** |
||
21 | * Set up a constructor that references the parent constructor. |
||
22 | * |
||
23 | * We use the parent reference to set some default configs. |
||
24 | */ |
||
25 | public function __construct( $page, $args = array() ) { |
||
37 | 2 | ||
38 | 2 | /** |
|
39 | * Adds extra markup in the toolbars before or after the list. |
||
40 | * |
||
41 | * @access protected |
||
42 | * |
||
43 | * @param string $which Add the markup after (bottom) or before (top) the list. |
||
44 | */ |
||
45 | protected function extra_tablenav( $which ) { |
||
91 | |||
92 | /** |
||
93 | * Returns the list of column and title names. |
||
94 | * |
||
95 | * @see WP_List_Table::::single_row_columns() |
||
96 | * |
||
97 | * @return array An associative array containing column information: 'slugs'=>'Visible Titles'. |
||
98 | */ |
||
99 | public function get_columns() { |
||
100 | $columns = array( |
||
101 | 2 | 'cb' => '<input type="checkbox" />', // Render a checkbox instead of text. |
|
102 | 'sent_date' => __( 'Sent at', 'email-log' ), |
||
103 | 2 | 'to' => __( 'To', 'email-log' ), |
|
104 | 2 | 'subject' => __( 'Subject', 'email-log' ), |
|
105 | 2 | ); |
|
106 | 2 | ||
107 | 2 | /** |
|
108 | * Filter the email log list table columns. |
||
109 | 2 | * |
|
110 | * @since 2.0 |
||
111 | * @param array $columns Columns of email log list table. |
||
112 | */ |
||
113 | return apply_filters( 'el_manage_log_columns', $columns ); |
||
114 | } |
||
115 | |||
116 | /** |
||
117 | * Returns the list of columns. |
||
118 | * |
||
119 | * @access protected |
||
120 | * |
||
121 | * @return array An associative array containing all the columns that should be sortable: 'slugs'=>array('data_values',bool). |
||
|
|||
122 | */ |
||
123 | protected function get_sortable_columns() { |
||
131 | |||
132 | /** |
||
133 | * Returns value for default columns. |
||
134 | * |
||
135 | * @access protected |
||
136 | * |
||
137 | * @param object $item Data object. |
||
138 | * @param string $column_name Column Name. |
||
139 | */ |
||
140 | protected function column_default( $item, $column_name ) { |
||
141 | /** |
||
142 | * Display Email Log list table columns. |
||
143 | * |
||
144 | * @since 2.0 |
||
145 | * |
||
146 | * @param string $column_name Column Name. |
||
147 | * @param object $item Data object. |
||
148 | */ |
||
149 | do_action( 'el_display_log_columns', $column_name, $item ); |
||
150 | } |
||
151 | |||
152 | /** |
||
153 | * Display sent date column. |
||
154 | * |
||
155 | * @access protected |
||
156 | * |
||
157 | * @param object $item Current item object. |
||
158 | * @return string Markup to be displayed for the column. |
||
159 | */ |
||
160 | protected function column_sent_date( $item ) { |
||
215 | |||
216 | /** |
||
217 | * To field. |
||
218 | * |
||
219 | * @access protected |
||
220 | * |
||
221 | * @param object $item |
||
222 | * @return string |
||
223 | */ |
||
224 | protected function column_to( $item ) { |
||
227 | |||
228 | /** |
||
229 | * Subject field. |
||
230 | * |
||
231 | * @access protected |
||
232 | * |
||
233 | * @param object $item |
||
234 | * @return string |
||
235 | */ |
||
236 | protected function column_subject( $item ) { |
||
239 | |||
240 | /** |
||
241 | * Markup for action column. |
||
242 | * |
||
243 | * @access protected |
||
244 | * |
||
245 | * @param object $item |
||
246 | * @return string |
||
247 | */ |
||
248 | protected function column_cb( $item ) { |
||
255 | |||
256 | /** |
||
257 | * Specify the list of bulk actions. |
||
258 | * |
||
259 | * @access protected |
||
260 | * |
||
261 | * @return array An associative array containing all the bulk actions: 'slugs'=>'Visible Titles'. |
||
262 | */ |
||
263 | protected function get_bulk_actions() { |
||
270 | |||
271 | /** |
||
272 | * Handles bulk actions. |
||
273 | * |
||
274 | * @access protected. |
||
275 | */ |
||
276 | protected function process_bulk_action() { |
||
283 | |||
284 | /** |
||
285 | * Prepare data for display. |
||
286 | */ |
||
287 | public function prepare_items() { |
||
308 | |||
309 | /** |
||
310 | * Displays default message when no items are found. |
||
311 | */ |
||
312 | public function no_items() { |
||
315 | |||
316 | /** |
||
317 | * Displays the search box. |
||
318 | * |
||
319 | * @since 2.0 |
||
320 | * @access public |
||
321 | * |
||
322 | * @param string $text The 'submit' button label. |
||
323 | * @param string $input_id ID attribute value for the search input field. |
||
324 | */ |
||
325 | public function search_box( $text, $input_id ) { |
||
351 | } |
||
352 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.