AJAX.php
3 years ago
Cleared_Cache_AJAX.php
3 years ago
Create_Campaign_AJAX.php
3 years ago
Delete_Campaign_AJAX.php
3 years ago
Delete_Data_AJAX.php
3 years ago
Export_Campaigns_AJAX.php
3 years ago
Export_Devices_AJAX.php
2 years ago
Export_Geo_AJAX.php
3 years ago
Export_Pages_AJAX.php
3 years ago
Export_Referrers_AJAX.php
3 years ago
Filters_AJAX.php
2 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
Create_Campaign_AJAX.php
20 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP_SCOPED\IAWP\AJAX; |
| 4 | |
| 5 | use IAWP_SCOPED\IAWP\Campaign_Builder; |
| 6 | use IAWP_SCOPED\IAWP\Utils\Security; |
| 7 | class Create_Campaign_AJAX extends AJAX |
| 8 | { |
| 9 | protected function action_name() : string |
| 10 | { |
| 11 | return 'iawp_create_campaign'; |
| 12 | } |
| 13 | protected function action_callback() : void |
| 14 | { |
| 15 | $campaign_builder = new Campaign_Builder(); |
| 16 | $html = $campaign_builder->create_campaign(Security::string(\trim($this->get_field('path'))), Security::string(\trim($this->get_field('utm_source'))), Security::string(\trim($this->get_field('utm_medium'))), Security::string(\trim($this->get_field('utm_campaign'))), Security::string(\trim($this->get_field('utm_term'))), Security::string(\trim($this->get_field('utm_content')))); |
| 17 | \wp_send_json_success(['html' => $html]); |
| 18 | } |
| 19 | } |
| 20 |