-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WPML translation of the Controls_Manager::URL not working as expected in our custom widget. #6786
Comments
thanks for reporting, sadly, we have no control over how WMPL handles translation of any control. thanks. |
I have the same issue. Did you figure anything out, @ryanlabelle |
Ok I figured it out. Try this:
The important thing here is to use a key for the array, and this key should be equal to your field name. And then you should use 'url' for the field key in the array... For editor_type you can also use LINK if you want, but I use LINE because otherwise relative links like '/something/' will not display in the WPML edit screen. |
Thanks @synio-wesley ! I'll give that a try. :) |
@synio-wesley Thanks again for your help. It's working, with on caveat, when I have two url controls in the same widget, WPML will only recognizes one of them. Any ideas?
Displays the following in the WPML editor: No issue if I have a single URL in the widget, but more than 1 and it's getting lost. |
I'll be reaching out to WPML as well. |
@ryanlabelle I have checked out this issue in detail for you, and I think I have found a bug in the WPML Elementor integration code. I have also written a fix for the problem. I will open a ticket on the wpml-page-builders-elementor GitHub that I found and hopefully they can fix it that way :-) |
@ryanlabelle As you can see, I have created a ticket so this issue can hopefully be fixed in a next version :-) In the meantime, you can probably work around the issue by writing a custom integration-class and re-implementing get() and update() so it handles this correctly... (not the easiest workaround...) |
@synio-wesley you rock! Thank you so much. It looks like they already responded. I hope that you have a great weekend. Cheers. |
@ryanlabelle Could you check out OnTheGoSystems/wpml-page-builders-elementor#65 and give the people over there a complete example that they can use for their tests? I don't really have the time to focus on a backwards-compatible fix right now, so I'm hoping they will be able to fix it once they have a complete example. (Otherwise, I might take a look again for another pull request taking backwards compatibility into account after my holidays in a few weeks.) |
Prerequisites
Description
We've followed the guide over here provided by WPML to translate our custom Elementor widget:
https://wpml.org/documentation/plugins-compatibility/elementor/how-to-add-wpml-support-to-custom-elementor-widgets/
It's working for most fields but the Controls_Manager::URL is an array with ['URL'], and ['is_external'] and that does not seem to be coming through in the Translation Editor.
The bundled Elementor button widget also uses the Controls_Manager::URL is coming through just fine in the translation editor, so it's something related to our custom widgets.
Here is the code sample from the WPML site for translating Elementor widgets.
That's great for a simple text field, how would one translate a field that uses the Controls_Manager::URL?
I'm also reaching out to the WPML team. I'll post any solutions that they provide here. 👍
The text was updated successfully, but these errors were encountered: