Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Change Excel download filename
- *
- * @param array $button_config Associative array of button options (mandatory 'extend' and 'text' (e.g. add pdf orientation with 'orientation' => 'landscape' )
- * @param int $view_id View ID
- */
- function gravityview_change_excel_download_filename( $button_config = array(), $view_id = 0 ) {
- // $button_config['extend'] = 'excelFlash'; /* If you want a save dialog, you'll need to un-comment this line */
- $button_config['filename'] = 'My new awesome Excel filename';
- return $button_config;
- }
- add_filter('gravityview/datatables/button_excel', 'gravityview_change_excel_download_filename', 10, 2 );
- /**
- * Change PDF download filename
- *
- * @param array $button_config Associative array of button options (mandatory 'extend' and 'text' (e.g. add pdf orientation with 'orientation' => 'landscape' )
- * @param int $view_id View ID
- */
- function gravityview_change_pdf_download_filename( $button_config = array(), $view_id = 0 ) {
- // $button_config['extend'] = 'pdfFlash'; /* If you want a save dialog, you'll need to un-comment this line */
- $button_config['filename'] = 'My new awesome PDF filename';
- return $button_config;
- }
- add_filter('gravityview/datatables/button_pdf', 'gravityview_change_pdf_download_filename', 10, 2 );
Add Comment
Please, Sign In to add comment