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
create_campaign_ajax.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP; |
| 4 | |
| 5 | class Create_Campaign_AJAX extends AJAX |
| 6 | { |
| 7 | protected function action_name(): string |
| 8 | { |
| 9 | return 'iawp_create_campaign'; |
| 10 | } |
| 11 | |
| 12 | protected function action_callback(): void |
| 13 | { |
| 14 | $campaign_builder = new Campaign_Builder(); |
| 15 | $html = $campaign_builder->create_campaign( |
| 16 | Security::string(trim($this->get_field('path'))), |
| 17 | Security::string(trim($this->get_field('utm_source'))), |
| 18 | Security::string(trim($this->get_field('utm_medium'))), |
| 19 | Security::string(trim($this->get_field('utm_campaign'))), |
| 20 | Security::string(trim($this->get_field('utm_term'))), |
| 21 | Security::string(trim($this->get_field('utm_content'))) |
| 22 | ); |
| 23 | |
| 24 | wp_send_json_success(['html' => $html]); |
| 25 | } |
| 26 | } |
| 27 |