woocommerce_product_export_row_data filter-hookWC 3.1.0

Allow third-party plugins to filter the data in a single row of the exported CSV file.

Usage

add_filter( 'woocommerce_product_export_row_data', 'wp_kama_woocommerce_product_export_row_data_filter', 10, 3 );

/**
 * Function for `woocommerce_product_export_row_data` filter-hook.
 * 
 * @param array                   $row      An associative array with the data of a single row in the CSV file.
 * @param WC_Product              $product  The product object correspnding to the current row.
 * @param WC_Product_CSV_Exporter $exporter The instance of the CSV exporter.
 *
 * @return array
 */
function wp_kama_woocommerce_product_export_row_data_filter( $row, $product, $exporter ){

	// filter...
	return $row;
}
$row(array)
An associative array with the data of a single row in the CSV file.
$product(WC_Product)
The product object correspnding to the current row.
$exporter(WC_Product_CSV_Exporter)
The instance of the CSV exporter.

Changelog

Since 3.1.0 Introduced.

Where the hook is called

WC_Product_CSV_Exporter::generate_row_data()
woocommerce_product_export_row_data
woocommerce/includes/export/class-wc-product-csv-exporter.php 268
return apply_filters( 'woocommerce_product_export_row_data', $row, $product, $this );

Where the hook is used in WooCommerce

Usage not found.