LLMS_Admin_Tool_Limited_Billing_Order_Locator::get_csv_file()

Create a csv “file” via output buffering and return it as a string.


Return Return

(string)


Top ↑

Source Source

File: includes/admin/tools/class-llms-admin-tool-limited-billing-order-locator.php

	protected function get_csv_file() {

		$csv = $this->get_csv();

		// Add header row.
		array_unshift(
			$csv,
			array(
				'Order ID',
				'Expected Payments',
				'Total Payments',
				'Successful Payments',
				'Refunded Payments',
				'Edit Link',
			)
		);

		// Create the CSV file.
		ob_start();
		$fh = fopen( 'php://output', 'w' );
		foreach ( $csv as $line ) {
			fputcsv( $fh, $line );
		}
		fclose( $fh ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose

		return ob_get_clean();

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.