models
4 years ago
queries
4 years ago
utils
4 years ago
chart.php
4 years ago
db.php
4 years ago
delete_data_ajax.php
4 years ago
filters.php
4 years ago
filters_ajax.php
4 years ago
rest_api.php
4 years ago
settings.php
4 years ago
settings_ajax.php
4 years ago
super_secret_content_generator.php
4 years ago
table.php
4 years ago
table_referrers.php
4 years ago
table_views.php
4 years ago
track_resource_changes.php
4 years ago
table_views.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP; |
| 4 | |
| 5 | class Table_Views extends Table |
| 6 | { |
| 7 | public function columns() |
| 8 | { |
| 9 | return [ |
| 10 | 'title' => esc_html__('Title', 'iawp'), |
| 11 | 'views' => esc_html__('Views', 'iawp'), |
| 12 | 'visitors' => esc_html__('Visitors', 'iawp'), |
| 13 | 'url' => esc_html__('URL', 'iawp'), |
| 14 | 'author' => esc_html__('Author', 'iawp'), |
| 15 | 'type' => esc_html__('Page Type', 'iawp'), |
| 16 | 'date' => esc_html__('Publish Date', 'iawp'), |
| 17 | 'category' => esc_html__('Post Category', 'iawp'), |
| 18 | ]; |
| 19 | } |
| 20 | |
| 21 | protected function table_name() |
| 22 | { |
| 23 | return 'views'; |
| 24 | } |
| 25 | |
| 26 | public function default_columns() |
| 27 | { |
| 28 | return ['title', 'views', 'visitors', 'url', 'type']; |
| 29 | } |
| 30 | |
| 31 | public function rows(array $dates) |
| 32 | { |
| 33 | list($start, $end) = $dates; |
| 34 | $resource_query = new Resources($start, $end); |
| 35 | $resources = $resource_query->get_resources(); |
| 36 | |
| 37 | return Page::ignore_page_nums_and_merge($resources); |
| 38 | } |
| 39 | } |
| 40 |