WC_CSV_Exporter::export_column_headers()protectedWC 3.1.0

Export column headers in CSV format.

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

Хуков нет.

Возвращает

Строку.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->export_column_headers();

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

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

Код WC_CSV_Exporter::export_column_headers() WC 8.7.0

protected function export_column_headers() {
	$columns    = $this->get_column_names();
	$export_row = array();
	$buffer     = fopen( 'php://output', 'w' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen
	ob_start();

	foreach ( $columns as $column_id => $column_name ) {
		if ( ! $this->is_column_exporting( $column_id ) ) {
			continue;
		}
		$export_row[] = $this->format_data( $column_name );
	}

	$this->fputcsv( $buffer, $export_row );

	return ob_get_clean();
}