Merge pull request #16803 from iamdharmesh/master

Apply filter on product csv importer steps.
This commit is contained in:
Mike Jolley 2017-09-15 16:39:20 -07:00 committed by GitHub
commit a62bb30200
1 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,7 @@ class WC_Product_CSV_Importer_Controller {
* Constructor.
*/
public function __construct() {
$this->steps = array(
$default_steps = array(
'upload' => array(
'name' => __( 'Upload CSV file', 'woocommerce' ),
'view' => array( $this, 'upload_form' ),
@ -98,6 +98,9 @@ class WC_Product_CSV_Importer_Controller {
'handler' => '',
),
);
$this->steps = apply_filters( 'woocommerce_product_csv_importer_steps', $default_steps );
$this->step = isset( $_REQUEST['step'] ) ? sanitize_key( $_REQUEST['step'] ) : current( array_keys( $this->steps ) );
$this->file = isset( $_REQUEST['file'] ) ? wc_clean( $_REQUEST['file'] ) : '';
$this->update_existing = isset( $_REQUEST['update_existing'] ) ? (bool) $_REQUEST['update_existing'] : false;