jochl
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
add_action( 'pmxe_before_export', 'wp_all_export_before_export', 10, 1 ); function wp_all_export_before_export( $export_id ) { if ($export_id == 2) { $exportRecord = new PMXE_Export_Record(); $exportRecord->getById($export_id); if ( $exportRecord->count == 0){ $exportRecord->set(array( 'triggered' => 0, 'processing' => 0, 'executing' => 0, 'canceled' => 1, 'canceled_on' => date('Y-m-d H:i:s') ))->update(); die(); } } }I feel like this should work – but it does not. Triggered via Cron.
Created something along these lines but it does not work – probably need to set the log aswell but I’m kind of stuck.
add_action( 'pmxe_before_export', 'wp_all_export_before_export', 10, 1 ); function wp_all_export_before_export( $export_id ) { // Unless you want this to execute for every export you should check the id here: if($export_id == 2){ $export = new PMXI_Export_Record(); $export->getById($export_id); if ( !$export->isEmpty() && $export->count < 1 ) { echo 'Import skipped because of empty file / < 100 records'; // stop import processing die(); } } }
Viewing 3 replies - 1 through 3 (of 3 total)