WooCommerce Code Reference

WC_Admin_Importers
in package

WC_Admin_Importers Class.

Table of Contents

$importers  : array<string|int, string>
Array of importer IDs.
__construct()  : mixed
Constructor.
add_to_menus()  : mixed
Add menu items for our custom importers.
admin_scripts()  : mixed
Register importer scripts.
do_ajax_product_import()  : mixed
Ajax callback for importing one batch of products from a CSV.
hide_from_menus()  : mixed
Hide menu items from view so the pages exist, but the menu items do not.
post_importer_compatibility()  : mixed
When running the WP XML importer, ensure attributes exist.
product_importer()  : mixed
The product importer.
register_importers()  : mixed
Register WordPress based importers.
tax_rates_importer()  : mixed
The tax rate importer which extends WP_Importer.
import_allowed()  : bool
Return true if WooCommerce imports are allowed for current user, false otherwise.

Properties

Methods

post_importer_compatibility()

When running the WP XML importer, ensure attributes exist.

public post_importer_compatibility() : mixed

WordPress import should work - however, it fails to import custom product attribute taxonomies. This code grabs the file before it is imported and ensures the taxonomies are created.

Return values
mixed

product_importer()

The product importer.

public product_importer() : mixed

This has a custom screen - the Tools > Import item is a placeholder. If we're on that screen, redirect to the custom one.

Return values
mixed

import_allowed()

Return true if WooCommerce imports are allowed for current user, false otherwise.

protected import_allowed() : bool
Return values
boolWhether current user can perform imports.