updated plugin Easy Digital Downloads version 3.1.2
This commit is contained in:
@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user