woocommerce_exporter_product_types filter-hookWC 5.1.0

Allow third-parties to filter the exportable product types.

Usage

add_filter( 'woocommerce_exporter_product_types', 'wp_kama_woocommerce_exporter_product_types_filter' );

/**
 * Function for `woocommerce_exporter_product_types` filter-hook.
 * 
 * @param array $product_types The product type key and label.
 *
 * @return array
 */
function wp_kama_woocommerce_exporter_product_types_filter( $product_types ){

	// filter...
	return $product_types;
}
$product_types(array)

The product type key and label.

  • Product(string)
    type key - eg 'variable', 'simple' etc.

  • A(string)
    translated product label which appears in the export product type dropdown.

Changelog

Since 5.1.0 Introduced.

Where the hook is called

WC_Admin_Exporters::get_product_types()
woocommerce_exporter_product_types
woocommerce/includes/admin/class-wc-admin-exporters.php 216
return apply_filters( 'woocommerce_exporter_product_types', $product_types );

Where the hook is used in WooCommerce

Usage not found.