Automattic\WooCommerce\Admin
ReportExporter::export_report
Process a report export action.
Method of the class: ReportExporter{}
No Hooks.
Returns
void. Nothing (null).
Usage
$result = ReportExporter::export_report( $page_number, $export_id, $report_type, $report_args );
- $page_number(int) (required)
- Page number for this action.
- $export_id(string) (required)
- Unique ID for report (timestamp expected).
- $report_type(string) (required)
- Report type. E.g.
'customers'. - $report_args(array) (required)
- Report parameters, passed to data query.
ReportExporter::export_report() ReportExporter::export report code WC 11.2.1
public static function export_report( $page_number, $export_id, $report_type, $report_args ) {
$report_args['page'] = $page_number;
$exporter = new ReportCSVExporter( $report_type, $report_args );
$exporter->set_filename( self::get_export_filename( $report_type, $export_id ) );
$exporter->generate_file();
self::update_export_percentage_complete( $report_type, $export_id, $exporter->get_percent_complete() );
}