where to add this filter? in which file should be added?
-
17-04-2021 - |
Question
For wordpress language switcher, this post was helpful for others, but I don't know where to add the mentioned filter
How to change language file used by _e function
add_filter('locale', function($locale) {
return esc_attr($_GET['language']);
});
Solution
Add this code to your functions.php file in your WordPress theme files.
See this article for some additional help: https://www.rosehosting.com/blog/how-to-add-code-to-functions-php-in-wordpress/
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange