Skip to content

Commit 2ff7ae0

Browse files
committed
Add pmxe_after_iteration #25
1 parent ac4d96e commit 2ff7ae0

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,5 @@ This GitHub repo serves as documentation for WP All Import and WP All Export's a
8282
* [pmxe_after_export](all-export/pmxe_after_export.php) - Perform some action after the export is complete.
8383
* [wp_all_export_generate_bundle](all-export/wp_all_export_generate_bundle.php) - Determine whether the bundle file should be generated.
8484
* [wp_all_export_zapier_response](all-export/wp_all_export_zapier_response.php) -
85-
* [wp_all_export_use_csv_compliant_line_endings](all-export/wp_all_export_use_csv_compliant_line_endings.php) - Use custom CSV writer when affected by https://bugs.php.net/bug.php?id=43225.
85+
* [wp_all_export_use_csv_compliant_line_endings](all-export/wp_all_export_use_csv_compliant_line_endings.php) - Use custom CSV writer when affected by https://bugs.php.net/bug.php?id=43225.
86+
* [pmxe_after_iteration](all-export/pmxe_after_iteration.php) - Runs after each cron processing iteration finishes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* =======================================
4+
* Action: pmxe_after_iteration
5+
* =======================================
6+
*
7+
* Runs after each cron processing iteration finishes.
8+
*
9+
*
10+
* @param $export_id int - The export ID.
11+
* @param $exportObj object - The export object.
12+
*
13+
*/
14+
15+
16+
add_action( 'pmxe_after_iteration', 'wpae_continue_cron', 10, 2 );
17+
18+
function wpae_continue_cron( $export_id, $exportObj ) {
19+
// Do something.
20+
}
21+
22+
//
23+
// Example: Make a cron export run continuously.
24+
//
25+
26+
add_action( 'pmxe_after_iteration', 'wpae_continue_cron', 10, 2 );
27+
28+
function wpae_continue_cron( $export_id, $exportObj ) {
29+
if ( $export_id == '12' ) { // change this to your export ID
30+
$cron_processing_url = 'http://lame-addax-cat.w6.wpsandbox.pro/wp-cron.php?export_key=g99mni1B6Kpu&export_id=12&action=processing'; // change to your real processing URL
31+
header( "Location: " . $cron_processing_url . "" );
32+
}
33+
}

0 commit comments

Comments
 (0)