WPForms: change the export CSV file separator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// For WPForms < v1.5.5, but should work with the latest version as well. | |
add_filter( | |
'wpforms_csv_export_separator', | |
function( $sep ) { | |
return ';'; | |
} | |
); | |
// Snippet below works since WPForms v1.5.5. | |
add_filter( | |
'wpforms_pro_admin_entries_export_configuration', | |
function( $config ) { | |
$config['csv_export_separator'] = ';'; | |
return $config; | |
} | |
); |
@fcamichel, could you please elaborate on this? In which situations isn't it working?
@slaFFik, we found out that with some of our themes our defined filter is never called. We fixed that with inserting your code into a custom plugin, called before the wpforms plugin (see https://wordpress.stackexchange.com/a/215651).
@fcamichel
Oh, correct, that's not the problem with the filter, but with the hooks loading order.
I usually create wp-content/mu-plugins/wpforms.php
and put there all the filters/actions that are related to the WPForms plugin, and do the same for other plugins (like wp-mail-smtp.php
etc). This helps keep everything organized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this hook is deprecated since 1.5.5 of the WPForms plugin but usage of configuration['csv_export_separator'] is not working in some versions.