I would like that when I search for a term then the results will be from ALL languages. I found this code, which doesn’t look “safe” to me.
<?php add_action('pre_get_posts', 'wpml_custom_query'); function wpml_custom_query($query) { if (is_search()) { $query->query_vars['suppress_filters'] = true; } }
The problem with this code is that the results contain duplicates from different languages. I would like in that case just to show the article from the current language. How do I approach this? Thank you for your time.