Automattic\WooCommerce\Admin

ReportExporter::export_report()public staticWC 1.0

Process a report export action.

Метод класса: ReportExporter{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = ReportExporter::export_report( $page_number, $export_id, $report_type, $report_args );
$page_number(int) (обязательный)
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() WC 8.7.0

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() );
}