WC_CSV_Exporter::export_rows()protectedWC 3.1.0

Export rows in CSV format.

Method of the class: WC_CSV_Exporter{}

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->export_rows();

Changelog

Since 3.1.0 Introduced.

WC_CSV_Exporter::export_rows() code WC 8.7.0

protected function export_rows() {
	$data   = $this->get_data_to_export();
	$buffer = fopen( 'php://output', 'w' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen
	ob_start();

	array_walk( $data, array( $this, 'export_row' ), $buffer );

	return apply_filters( "woocommerce_{$this->export_type}_export_rows", ob_get_clean(), $this );
}