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
Migration_Status_AJAX.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\AJAX; |
| 4 | |
| 5 | use IAWP\Migrations; |
| 6 | |
| 7 | class Migration_Status_AJAX extends AJAX |
| 8 | { |
| 9 | protected function action_name(): string |
| 10 | { |
| 11 | return 'iawp_migration_status'; |
| 12 | } |
| 13 | |
| 14 | protected function allowed_during_migrations(): bool |
| 15 | { |
| 16 | return true; |
| 17 | } |
| 18 | |
| 19 | protected function action_callback(): void |
| 20 | { |
| 21 | if (!Migrations\Migration::is_actually_migrating()) { |
| 22 | Migrations\Migration::create_or_migrate(); |
| 23 | } |
| 24 | |
| 25 | wp_send_json_success([ |
| 26 | 'isMigrating' => Migrations\Migration::is_migrating(), |
| 27 | ]); |
| 28 | } |
| 29 | } |
| 30 |