Guest User

Untitled

a guest
Dec 15th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Change Excel download filename
  5. *
  6. * @param array $button_config Associative array of button options (mandatory 'extend' and 'text' (e.g. add pdf orientation with 'orientation' => 'landscape' )
  7. * @param int $view_id View ID
  8. */
  9. function gravityview_change_excel_download_filename( $button_config = array(), $view_id = 0 ) {
  10. // $button_config['extend'] = 'excelFlash'; /* If you want a save dialog, you'll need to un-comment this line */
  11. $button_config['filename'] = 'My new awesome Excel filename';
  12.  
  13. return $button_config;
  14. }
  15.  
  16. add_filter('gravityview/datatables/button_excel', 'gravityview_change_excel_download_filename', 10, 2 );
  17.  
  18.  
  19. /**
  20. * Change PDF download filename
  21. *
  22. * @param array $button_config Associative array of button options (mandatory 'extend' and 'text' (e.g. add pdf orientation with 'orientation' => 'landscape' )
  23. * @param int $view_id View ID
  24. */
  25. function gravityview_change_pdf_download_filename( $button_config = array(), $view_id = 0 ) {
  26. // $button_config['extend'] = 'pdfFlash'; /* If you want a save dialog, you'll need to un-comment this line */
  27. $button_config['filename'] = 'My new awesome PDF filename';
  28.  
  29. return $button_config;
  30. }
  31.  
  32. add_filter('gravityview/datatables/button_pdf', 'gravityview_change_pdf_download_filename', 10, 2 );
Add Comment
Please, Sign In to add comment