Automattic\WooCommerce\Admin

ReportCSVExporter::get_download_filename │ public │ WC 11.2.0

Get the name the export is downloaded as.

The stored file keeps get_filename(), which only has to identify the export.

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

Хуков нет.

Возвращает

string.

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

$ReportCSVExporter = new ReportCSVExporter();
$ReportCSVExporter->get_download_filename();

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

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

Код ReportCSVExporter::get_download_filename() WC 11.3.0

public function get_download_filename() {
	$filename = $this->get_filename();

	if ( '' === $this->download_suffix ) {
		return $filename;
	}

	// Stripped and restored the way set_filename() does it, so the name keeps a single .csv.
	return sanitize_file_name( str_replace( '.csv', '', $filename ) . '-' . $this->download_suffix . '.csv' );
}