PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.0.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.0.1
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Controllers / Automations / MassAction.php

MassAction.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 11.0.1, at back/Controllers/Automations/MassAction.php

46 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AcyMailing\Controllers\Automations;
4
5 use AcyMailing\Classes\AutomationClass;
6
7 trait MassAction
8 {
9 public function setFilterMassAction(): void
10 {
11 wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token');
12
13 $this->setSaveFilters(true);
14 $this->summary();
15 }
16
17 public function setActionMassAction(): void
18 {
19 wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token');
20
21 $this->getSaveActions(true);
22 $this->filter();
23 }
24
25 public function processMassAction(): void
26 {
27 wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token');
28
29 $automationClass = new AutomationClass();
30 $massAction = acym_getVar('array', 'massAction', [], 'SESSION');
31 if (!empty($massAction)) {
32 $automation = new \stdClass();
33 $automation->filters = json_encode($massAction['filters']);
34 $automation->actions = json_encode($massAction['actions']);
35 $automationClass->execute($automation);
36
37 if (!empty($automationClass->report)) {
38 foreach ($automationClass->report as $oneReport) {
39 acym_enqueueMessage($oneReport, 'info');
40 }
41 }
42 }
43 $this->listing();
44 }
45 }
46