woocommerce_csv_exporter_fopen_mode filter-hookWC 6.8.0

Filters the mode parameter which specifies the type of access you require to the stream (used during file writing for CSV exports). Defaults to 'a+' (which supports both reading and writing, and places the file pointer at the end of the file).

Usage

add_filter( 'woocommerce_csv_exporter_fopen_mode', 'wp_kama_woocommerce_csv_exporter_fopen_mode_filter' );

/**
 * Function for `woocommerce_csv_exporter_fopen_mode` filter-hook.
 * 
 * @param string $fopen_mode, either (r, r+, w, w+, a, a+, x, x+, c, c+, e)
 *
 * @return string
 */
function wp_kama_woocommerce_csv_exporter_fopen_mode_filter( $fopen_mode, ){

	// filter...
	return $fopen_mode,;
}
$fopen_mode,(string)
either (r, r+, w, w+, a, a+, x, x+, c, c+, e)

Changelog

Since 6.8.0 Introduced.

Where the hook is called

WC_CSV_Batch_Exporter::write_csv_data()
woocommerce_csv_exporter_fopen_mode
woocommerce/includes/export/abstract-wc-csv-batch-exporter.php 150
$fopen_mode = apply_filters( 'woocommerce_csv_exporter_fopen_mode', 'a+' );

Where the hook is used in WooCommerce

Usage not found.