Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Plugin now works with GTranslate
- This topic has 5 replies, 2 voices, and was last updated 5 years, 5 months ago by
Ernest Marcinko.
-
AuthorPosts
-
October 14, 2020 at 10:32 pm #29800
timburkart
ParticipantHi!
I have been working with the folks at gtranslate and they made some adjustments to one of your js files. I am attaching the changed version to this ticket. My question is can you possibly incorporate these changes into your code base?
Thank you!
October 15, 2020 at 10:15 am #29807Ernest Marcinko
KeymasterHi,
Thank you very much. I checked the source, but I don’t think I can incorporate that change – as it would break the redirection permalinks for every site where Gtranslate is not present. In cases where gtranslate is present, then I am not sure if the permalink is always used as in your case like:
siteurl.com/language/– it might be something else for different configurations(?), I’m not sure.I can however add hooks/events to the upcoming release, to have access to the redirection URL on the fly. That allows changing it via a custom code placed into the functions.php file in your child theme directory.
After the next plugin release is ready (4.20, it should be 2-4 weeks), please place this code functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_action('wp_footer', 'asp_custom_js_hook'); function asp_custom_js_hook() { ?> <script> wp.hooks.addFilter('asp_redirect_url', 'asp', function(url){ return url.replace( "gmoresearch.org/", "gmoresearch.org/" + (document.querySelector("html").lang.indexOf("en") > -1 ? "" : document.querySelector("html").lang )); }, 10); </script> <?php }That will permanently fix the issue in your case.
December 20, 2020 at 9:15 pm #30820timburkart
ParticipantHi Ernest,
Could you please confirm that you implemented this functionality in the 4.20 release?
Thank you!
Tim Burkart
December 21, 2020 at 11:01 am #30833Ernest Marcinko
KeymasterHi Tim,
Yes, it is implemented.
December 22, 2020 at 6:23 pm #30879timburkart
ParticipantHello Ernest,
I just want to thank you for this functionality! I have confirmed that it works on my site.
Best regards,
Tim Burkart
December 23, 2020 at 9:30 am #30889Ernest Marcinko
KeymasterYou are welcome, thank you for the feedback!
-
AuthorPosts
- You must be logged in to reply to this topic.