This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
Use this filter to add, rename and remove a column from CSV export.
Usage
add_filter( 'frm_export_csv_headings', 'rename_timestamp_column_in_csv_export' );
Parameters
- $headings (array)
Examples
Rename timestamp column
Use the code below to rename the timestamp column in CSV export.
add_filter( 'frm_export_csv_headings', 'rename_timestamp_column_in_csv_export' );
function rename_timestamp_column_in_csv_export( $headings ) {
$headings['created_at'] = 'New Timestamp Column Name';
return $headings;
}
Remove IP column
Use the code below to remove the IP column from CSV export.
add_filter( 'frm_export_csv_headings', 'remove_ip_from_csv_export' );
function remove_ip_from_csv_export( $headings ) {
unset( $headings['ip'] );
return $headings;
}
Add custom heading
Use the code below to allow custom heading in CSV export. The supported heading values include:
- IDs of fields in the form.
- Other standard headers: id, item_key, name, description, ip, form_id, post_id, user_id, parent_item_id, is_draft, updated_by, created_at, updated_at.
- For comments: comment, comment_user_id, comment_created_at.
The headers should match the order of the columns.
add_filter( 'frm_export_csv_headings', 'add_custom_heading_in_csv_export' );
function add_custom_heading_in_csv_export( $headings ) {
$headings['an_extra_column'] = 'New column name';
return $headings;
}