ajax
3 years ago
databases
3 years ago
migrations
3 years ago
models
3 years ago
queries
3 years ago
utils
3 years ago
chart.php
3 years ago
chart_geo.php
3 years ago
dashboard_widget.php
3 years ago
db.php
3 years ago
filters.php
3 years ago
freemius.php
3 years ago
independent_analytics.php
3 years ago
known_referrers.php
3 years ago
quick_stats.php
3 years ago
rest_api.php
3 years ago
settings.php
3 years ago
table.php
3 years ago
table_geo.php
3 years ago
table_referrers.php
3 years ago
table_views.php
3 years ago
track_resource_changes.php
3 years ago
view_counter.php
3 years ago
table_views.php
39 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 | |
| 36 | return $resource_query->get_resources(); |
| 37 | } |
| 38 | } |
| 39 |