woocommerce_csv_exporter_fopen_mode
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' (append, write-only, placing the file pointer at the end of the file), which is all CSV export needs and is supported by the widest range of stream wrappers.
Использование
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 One of (r, r+, w, w+, a, a+, x, x+, c, c+), optionally followed by
* flags such as "b", "t" or "e". (append, write-only) for broad
* stream-wrapper compatibility.
*
* @return string
*/
function wp_kama_woocommerce_csv_exporter_fopen_mode_filter( $fopen_mode ){
// filter...
return $fopen_mode;
}
- $fopen_mode(строка)
- One of (r, r+, w, w+, a, a+, x, x+, c, c+), optionally followed by flags such as "b", "t" or "e". (append, write-only) for broad stream-wrapper compatibility.
По умолчанию: "a"
Список изменений
| С версии 6.8.0 | Введена. |
Где вызывается хук
woocommerce_csv_exporter_fopen_mode
woocommerce/includes/export/abstract-wc-csv-batch-exporter.php 155
$fopen_mode = apply_filters( 'woocommerce_csv_exporter_fopen_mode', 'a' );