Automattic\WooCommerce\Admin

ReportExporter::get_download_url │ public static │ WC 11.2.0

Get the URL a finished report export is downloaded from.

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

Хуков нет.

Возвращает

string.

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

$result = ReportExporter::get_download_url( $report_type, $export_id, $report_args );
$report_type(строка) (обязательный)
Report type. E.g. 'customers'.
$export_id(строка) (обязательный)
Unique ID for report (timestamp expected).
$report_args(массив)
Report parameters the export was queued with. When they name a date range, the link carries it so the download is named after it.
По умолчанию: array()

Список изменений

С версии 11.2.0 Введена.

Код ReportExporter::get_download_url() WC 11.3.0

public static function get_download_url( $report_type, $export_id, $report_args = array() ) {
	$query_args = array(
		'action'   => self::DOWNLOAD_EXPORT_ACTION,
		'filename' => self::get_export_filename( $report_type, $export_id ),
	);

	$date_range = self::get_export_date_range( $report_args );
	if ( $date_range ) {
		$query_args['date_range'] = $date_range['after'] . '-to-' . $date_range['before'];
	}

	return add_query_arg( $query_args, admin_url() );
}