AJAX.php
3 years ago
Cleared_Cache_AJAX.php
3 years ago
Create_Campaign_AJAX.php
3 years ago
Delete_Data_AJAX.php
3 years ago
Export_Campaigns_AJAX.php
3 years ago
Export_Geo_AJAX.php
3 years ago
Export_Referrers_AJAX.php
3 years ago
Export_Views_AJAX.php
3 years ago
Filters_AJAX.php
3 years ago
Migration_Status_AJAX.php
3 years ago
Real_Time_AJAX.php
3 years ago
Test_Email_AJAX.php
3 years ago
Update_Capabilities_AJAX.php
3 years ago
Export_Views_AJAX.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\AJAX; |
| 4 | |
| 5 | use IAWP\Capability_Manager; |
| 6 | use IAWP\Queries\Resources; |
| 7 | use IAWP\Tables\Table_Views; |
| 8 | |
| 9 | class Export_Views_AJAX extends AJAX |
| 10 | { |
| 11 | protected function action_name(): string |
| 12 | { |
| 13 | return 'iawp_export_views'; |
| 14 | } |
| 15 | |
| 16 | protected function action_callback(): void |
| 17 | { |
| 18 | if (!Capability_Manager::can_edit()) { |
| 19 | return; |
| 20 | } |
| 21 | |
| 22 | $resources = new Resources(); |
| 23 | $rows = $resources->fetch(); |
| 24 | |
| 25 | $table = new Table_Views(); |
| 26 | $csv = $table->csv($rows); |
| 27 | |
| 28 | echo wp_kses($csv, 'post'); |
| 29 | } |
| 30 | } |
| 31 |