PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / src / Scheduling / Export.php
wp-all-export / src / Scheduling Last commit date
Exception 8 years ago Interval 8 years ago Timezone 7 years ago views 3 weeks ago Config.php 8 years ago Connection.php 8 years ago Export.php 3 weeks ago LicensingManager.php 1 year ago Scheduling.php 1 year ago SchedulingApi.php 3 years ago
Export.php
53 lines
1 <?php
2
3 namespace Wpae\Scheduling;
4
5
6 class Export
7 {
8
9 public function trigger($export)
10 {
11 $export->set(array(
12 'triggered' => 1,
13 'exported' => 0,
14 'last_activity' => date('Y-m-d H:i:s') // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date -- DB timestamp must match local-timezone format used by Manage Exports UI readers (mysql2date / strtotime / human_time_diff)
15 ))->update();
16 }
17
18 /**
19 * @param $export
20 * @return array
21 */
22 public function process($export)
23 {
24 // trigger update child exports with correct WHERE & JOIN filters
25 if (!empty($export->options['cpt']) and class_exists('WooCommerce') and in_array('shop_order', $export->options['cpt']) and empty($export->parent_id)) {
26 $queue_exports = \XmlExportWooCommerceOrder::prepare_child_exports($export, true);
27
28 if (empty($queue_exports)) {
29 delete_option('wp_all_export_queue_' . $export->id);
30 } else {
31 update_option('wp_all_export_queue_' . $export->id, $queue_exports);
32 }
33 }
34 // remove child export from queue
35 if (!empty($export->parent_id)) {
36 $queue_exports = get_option('wp_all_export_queue_' . $export->parent_id);
37
38 if (!empty($queue_exports)) {
39 foreach ($queue_exports as $key => $queue_export) {
40 if ($queue_export == $export->id) {
41 unset($queue_exports[$key]);
42 }
43 }
44 }
45
46 if (empty($queue_exports)) {
47 delete_option('wp_all_export_queue_' . $export->parent_id);
48 } else {
49 update_option('wp_all_export_queue_' . $export->parent_id, $queue_exports);
50 }
51 }
52 }
53 }