Filter
rpress_export_get_data_{$export_type}
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#
| Parameter | Type | Description |
|---|---|---|
$data | array | List 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), inRPRESS_Customers_Export::get_data()includes/admin/reporting/class-export-earnings.php(line 103), inRPRESS_Earnings_Export::get_data()includes/admin/reporting/class-export-fooditem-history.php(line 92), inRPRESS_Fooditem_History_Export::get_data()includes/admin/reporting/class-export-payments.php(line 173), inRPRESS_Payments_Export::get_data()includes/admin/reporting/class-export.php(line 110), inRPRESS_Export::get_data()includes/admin/reporting/export/class-batch-export-api-requests.php(line 86), inRPRESS_Batch_API_Requests_Export::get_data()includes/admin/reporting/export/class-batch-export-customers.php(line 153), inRPRESS_Batch_Customers_Export::get_data()includes/admin/reporting/export/class-batch-export-earnings-report.php(line 253), inRPRESS_Batch_Earnings_Report_Export::get_data()- and 4 more places.
See also#
rpress_export_get_datarpress_export_csv_cols_%7B%24export_type%7D
Was this page helpful?
