Automattic\WooCommerce\Admin
ReportExporter::export_report() public WC 1.0
Process a report export action.
{} Это метод класса: ReportExporter{}
Хуков нет.
Возвращает
null
. Null. Ничего.
Использование
$result = ReportExporter::export_report( $page_number, $export_id, $report_type, $report_args );
- $page_number(число) (обязательный)
- Page number for this action.
- $export_id(строка) (обязательный)
- Unique ID for report (timestamp expected).
- $report_type(строка) (обязательный)
- Report type. E.g. 'customers'.
- $report_args(массив) (обязательный)
- Report parameters, passed to data query.
Код ReportExporter::export_report() ReportExporter::export report WC 5.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( "wc-{$report_type}-report-export-{$export_id}" );
$exporter->generate_file();
self::update_export_percentage_complete( $report_type, $export_id, $exporter->get_percent_complete() );
}