Archived topic
Is there an easy way to add just one filter in Generatepress ?
1 reply · Started by Frans on October 19, 2021
I want to add a filter to let the csv-export of Flamingo work properly:
function sln_content_export($input) {
return preg_replace("/\r\n|\r|\n/",' ',$input);
}
add_filter('flamingo_csv_quotation', 'sln_content_export', 999);
I added this function to functions.php of Generatepress and it works properly. In the documentation, Generatepress states that this is not the correct way: a codesnippets plugin or child theme would be better.
Is this true ? Or is there an easier way to add just my filter to Generatepress (e.g. a Hook)?
Thanks !
Frans
Hi there,
The documentation is correct. You will need to use one of these methods:
Adding PHP: https://docs.generatepress.com/article/adding-php/