Skip to content
Docs
Get RestroPress

Filter

rpress_export_get_data_{$export_type}

Updated
On this page

Filters the rows written to a CSV export of one specific export type.

Runs right after rpress_export_get_data in each exporter, with the export type in the hook name. Export types in this version include default, customers, earnings, fooditem_history, payments, fooditems, file_fooditems, sales, api_requests and earnings_report.

Parameters#

ParameterTypeDescription
$dataarrayList of rows, each an associative array of column ID => value.

Return value#

array. The rows to export.

Example#

function my_payments_export_rows( $data ) {
	foreach ( $data as $key => $row ) {
		if ( isset( $row['email'] ) && false !== strpos( $row['email'], '@example.com' ) ) {
			unset( $data[ $key ] );
		}
	}
	return $data;
}
add_filter( 'rpress_export_get_data_payments', 'my_payments_export_rows', 10, 1 );

Notes#

The earnings_report batch exporter passes two extra arguments: $start_date and $end_date. All other exporters pass only $data.

Source#

Applied in:

  • includes/admin/reporting/class-export-customers.php (line 132), in RPRESS_Customers_Export::get_data()
  • includes/admin/reporting/class-export-earnings.php (line 103), in RPRESS_Earnings_Export::get_data()
  • includes/admin/reporting/class-export-fooditem-history.php (line 92), in RPRESS_Fooditem_History_Export::get_data()
  • includes/admin/reporting/class-export-payments.php (line 173), in RPRESS_Payments_Export::get_data()
  • includes/admin/reporting/class-export.php (line 110), in RPRESS_Export::get_data()
  • includes/admin/reporting/export/class-batch-export-api-requests.php (line 86), in RPRESS_Batch_API_Requests_Export::get_data()
  • includes/admin/reporting/export/class-batch-export-customers.php (line 153), in RPRESS_Batch_Customers_Export::get_data()
  • includes/admin/reporting/export/class-batch-export-earnings-report.php (line 253), in RPRESS_Batch_Earnings_Report_Export::get_data()
  • and 4 more places.

See also#

Was this page helpful?