WC_Admin_Importers::__construct()publicWC 1.0

Constructor.

{} It's a method of the class: WC_Admin_Importers{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Admin_Importers = new WC_Admin_Importers();
$WC_Admin_Importers->__construct();

Code of WC_Admin_Importers::__construct() WC 6.7.0

public function __construct() {
	if ( ! $this->import_allowed() ) {
		return;
	}

	add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
	add_action( 'admin_init', array( $this, 'register_importers' ) );
	add_action( 'admin_head', array( $this, 'hide_from_menus' ) );
	add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
	add_action( 'wp_ajax_woocommerce_do_ajax_product_import', array( $this, 'do_ajax_product_import' ) );

	// Register WooCommerce importers.
	$this->importers['product_importer'] = array(
		'menu'       => 'edit.php?post_type=product',
		'name'       => __( 'Product Import', 'woocommerce' ),
		'capability' => 'import',
		'callback'   => array( $this, 'product_importer' ),
	);
}