You appear to be a bot. Output may be restricted
Description
Process a step
Usage
$bool = EDD_Batch_Payments_Import::process_step();
Parameters
Returns
bool
Source
File name: easy-digital-downloads/includes/admin/import/class-batch-import-payments.php
Lines:
1 to 53 of 53
public function process_step() { $more = false; if ( ! $this->can_import() ) { wp_die( __( 'You do not have permission to import data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); } // Remove certain actions to ensure they don't fire when creating the payments remove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 ); remove_action( 'edd_admin_sale_notice', 'edd_admin_email_notice', 10 ); $i = 1; $offset = $this->step > 1 ? ( $this->per_step * ( $this->step - 1 ) ) : 0; if( $offset > $this->total ) { $this->done = true; // Clean up the temporary records in the payment import process global $wpdb; $sql = "DELETE FROM {$wpdb->prefix}edd_customermeta WHERE meta_key = '_canonical_import_id'"; $wpdb->query( $sql ); // Delete the uploaded CSV file. unlink( $this->file ); } if( ! $this->done && $this->csv ) { $more = true; foreach( $this->csv as $key => $row ) { // Skip all rows until we pass our offset if( $key + 1 <= $offset ) { continue; } // Done with this batch if( $i > $this->per_step ) { break; } // Import payment $this->create_payment( $row ); $i++; } } return $more; }