WC_Admin_Exporters::get_product_typespublic staticWC 5.1.0

Gets the product types that can be exported.

Method of the class: WC_Admin_Exporters{}

Hooks from the method

Returns

Array. The product types keys and labels.

Usage

$result = WC_Admin_Exporters::get_product_types();

Changelog

Since 5.1.0 Introduced.

WC_Admin_Exporters::get_product_types() code WC 9.9.3

public static function get_product_types() {
	$product_types                           = wc_get_product_types();
	$product_types[ ProductType::VARIATION ] = __( 'Product variations', 'woocommerce' );

	/**
	 * Allow third-parties to filter the exportable product types.
	 *
	 * @since 5.1.0
	 * @param array $product_types {
	 *     The product type key and label.
	 *
	 *     @type string Product type key - eg 'variable', 'simple' etc.
	 *     @type string A translated product label which appears in the export product type dropdown.
	 * }
	 */
	return apply_filters( 'woocommerce_exporter_product_types', $product_types );
}