WordPress at Your Fingertips
function is not described

WC_CSV_Exporter::export_row() protected WC 3.1.0

Export rows to an array ready for the CSV.

{} It's a method of the class: WC_CSV_Exporter{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->export_row( $row_data, $key, $buffer );
$row_data(array) (required)
Data to export.
$key(string) (required)
Column being exported.
$buffer(resource) (required)
Output buffer.

Changelog

Since 3.1.0 Introduced.

Code of WC_CSV_Exporter::export_row() WC 5.9.0

protected function export_row( $row_data, $key, $buffer ) {
	$columns    = $this->get_column_names();
	$export_row = array();

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

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

	++ $this->exported_row_count;
}