Hi guys,
there seems to have been a change in logic with one of the recent enfold updates. We use qtranlsate-xt for language translation. The search results are translated as well but recently the URL is no longer translated. Is there a function hook that we can use to translate the URL?
Best,
Elmar
Hey El,
Thank you for the inquiry.
The theme or the AJAX search does not support the qtranlsate-xt plugin ever since. If you look at the following documentation, only Polylang, Relevanssi and SearchWP plugins have default integrations for the search feature.
// https://kriesi.at/documentation/enfold/search/
By default, the AJAX search relies on the get_posts function. You may need to ask the plugin author and ask them how the plugin retrieves the posts translation.
Best regards,
Ismael
Hi Ismael,
you do not need to to support qtranslate-xt – it just works and it did work for years with enfold. It stopped working recently and I need to check what caused it. Can you point me to the enfold files that handles the AJAX search? Thanks!
Best,
Elmar
Hi,
The avia_ajax_search function is located in the functions-enfold.php file. By default, it is using the get_posts function to retrieve the posts.
/**
* @used_by Avia_Relevanssi 10
*
* @param string $function_name
* @param array $search_query
* @param array $search_parameters
* @param array $defaults
* @return string
*/
$query_function = apply_filters( 'avf_ajax_search_function', 'get_posts', $search_query, $search_parameters, $defaults );
You may need to use the avf_ajax_search_function in order adjust it to the function used by the plugin.
Best regards,
Ismael