WC_Admin_Exporters::get_product_types()
Gets the product types that can be exported.
Method of the class: WC_Admin_Exporters{}
Hooks from the method
Return
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() WC Admin Exporters::get product types code WC 8.6.1
public static function get_product_types() { $product_types = wc_get_product_types(); $product_types['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 ); }