woocommerce_product_export_row_data
Allow third-party plugins to filter the data in a single row of the exported CSV file.
Использование
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(массив)
- 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.
Список изменений
С версии 3.1.0 | Введена. |
Где вызывается хук
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 );