woocommerce_exporter_product_types хук-фильтрWC 5.1.0

Allow third-parties to filter the exportable product types.

Использование

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(массив)

The product type key and label.

  • Product(строка)
    type key - eg 'variable', 'simple' etc.

  • A(строка)
    translated product label which appears in the export product type dropdown.

Список изменений

С версии 5.1.0 Введена.

Где вызывается хук

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 );

Где используется хук в WooCommerce

Использование не найдено.