updated plugin Easy Digital Downloads version 3.1.2

This commit is contained in:
2023-06-28 12:45:44 +00:00
committed by Gitium
parent 44df590080
commit f710fa7de2
120 changed files with 5556 additions and 3347 deletions

View File

@ -85,13 +85,23 @@ class EDD_Batch_Import {
*/
public function __construct( $_file = '', $_step = 1 ) {
$this->step = $_step;
$this->file = $_file;
$this->done = false;
$this->csv = $this->get_csv_file( $this->file );
$this->step = $_step;
$this->done = false;
if ( ! empty( $_file ) ) {
$this->set_up_csv( $_file );
}
}
/**
* Sets up the CSV file for importing.
*
* @param [type] $file
* @return void
*/
public function set_up_csv( $file ) {
$this->csv = $this->get_csv_file( $file );
$this->total = count( $this->csv );
$this->init();
}
/**
@ -121,7 +131,8 @@ class EDD_Batch_Import {
* @return array
*/
public function get_csv_file( $file ) {
$csv = array_map( 'str_getcsv', file( $this->file ) );
$this->file = $file;
$csv = array_map( 'str_getcsv', file( $file ) );
array_walk(
$csv,
function ( &$a ) use ( $csv ) {