Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Created August 17, 2018 05:25
Show Gist options
  • Save rafaehlers/875fcca895a0687027388c2cae83955b to your computer and use it in GitHub Desktop.
Save rafaehlers/875fcca895a0687027388c2cae83955b to your computer and use it in GitHub Desktop.
Filter to change the filename of the exported .XLSX file and to remove the first row containing the document title
<?php // MAKE SURE TO REMOVE THIS FIRST LINE BEFORE COPYING THIS CODE TO YOUR FUNCTIONS.PHP FILE
add_filter('gravityview/datatables/button_excel','gravityview_excel_export_settings', 10 ,2);
function gravityview_excel_export_settings( $button_config = array(), $view_id){
$button_config['filename'] = 'dt-excel-test'; //you can change the filename here (don't type the extension)
$button_config['title'] = '';
return $button_config;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment