Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Plugin now works with GTranslate
This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 5 months ago.
- AuthorPosts
- October 14, 2020 at 10:32 pm #29800
Hi!
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!
Attachments:
You must be logged in to view attached files.October 15, 2020 at 10:15 am #29807Hi,
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.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 20, 2020 at 9:15 pm #30820Hi 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 #30833Hi Tim,
Yes, it is implemented.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 22, 2020 at 6:23 pm #30879Hello 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 #30889You are welcome, thank you for the feedback!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.