Filter
rpress_export_csv_cols_{$export_type}
On this page
Filters the column list of a CSV export of one specific export type.
Runs when a legacy (non-batch) exporter builds its header row and when it decides which row keys to write. Keys are column IDs matching the keys of the row arrays; values are the header labels. Removing a key hides that column, because rows are written only for keys present in this list.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$cols | array | Array of column ID => header label. |
Return value#
array. The column ID => label array.
Example#
function my_payments_export_cols( $cols ) {
unset( $cols['address2'], $cols['zip'] );
return $cols;
}
add_filter( 'rpress_export_csv_cols_payments', 'my_payments_export_cols', 10, 1 );
Notes#
Fired from the base RPRESS_Export::get_csv_cols(). Export types include default, customers, earnings, fooditem_history and payments.
Source#
Applied in:
includes/admin/reporting/class-export.php(line 72), inRPRESS_Export::get_csv_cols()
See also#
rpress_export_get_data_%7B%24export_type%7D
Was this page helpful?
