From d877ab31c5d4327083eb258e74d38522188bad91 Mon Sep 17 00:00:00 2001 From: Dharmesh Patel Date: Wed, 13 Sep 2017 23:56:15 +0530 Subject: [PATCH] Apply filter on product csv importer steps. --- .../importers/class-wc-product-csv-importer-controller.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/admin/importers/class-wc-product-csv-importer-controller.php b/includes/admin/importers/class-wc-product-csv-importer-controller.php index eb6b5138f22..1b4f3f7554d 100644 --- a/includes/admin/importers/class-wc-product-csv-importer-controller.php +++ b/includes/admin/importers/class-wc-product-csv-importer-controller.php @@ -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;