WC_CSV_Batch_Exporter::generate_file
Generate the CSV file.
Method of the class: WC_CSV_Batch_Exporter{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_CSV_Batch_Exporter = new WC_CSV_Batch_Exporter(); $WC_CSV_Batch_Exporter->generate_file();
Changelog
| Since 3.1.0 | Introduced. |
WC_CSV_Batch_Exporter::generate_file() WC CSV Batch Exporter::generate file code WC 11.2.1
public function generate_file() {
if ( 1 === $this->get_page() ) {
if ( file_exists( $this->get_file_path() ) ) {
wp_delete_file( $this->get_file_path() );
}
// We need to initialize the file here.
$this->get_file();
}
$this->prepare_data_to_export();
$this->write_csv_data( $this->get_csv_data() );
}