Nobody is using Polylang with Ultimate WP Query Search Filter?
I’ve managed to add a hidden lang value with
add_action('uwpqsf_form_mid', 'my_search_form');
function my_search_form($html) {
$html = '<input type="hidden" name="lang" value="'. pll_current_language().'"/>';
echo $html;
}
but I need it here mywebsite.it/en?unonce=0266f30700&uformid=126…..
not appended at the end of the url
suggestions?
Hi
Did you try:
<input type="hidden" name="lang" value="<?php echo pll_current_language(); ?>"/>
hi Chrystl,
that’s exactly what I posted before.
but that appends the lang at the end of the url, instead of adding it like this:
mywebsite.it/en?unonce=0266f30700&uformid=126…..
It should work but it is not a clean solution since it hacks the plugin code. In the /ultimate-wp-query-search-filter/html/searchform.php at line 118, replace
echo $html;
by
echo apply_filters('get_search_form', $html);
Great it works.
Thank you.
I wonder if there is a way to put it in functions.php
Unfortunately no way to integrate this in the functions.php.
You can ask to the Ultimate WP Query Search Filter author if he can integrate it in its plugin.
Edit: Could you please mark your topic as “resolved”?