This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem: I have installed a plugin (Divi Dashboard Welcome) that doesn't seem to support WPML is the way it is configured on my site.

The plugin is explained at the following link: https://divilife.com/downloads/divi-dashboard-welcome/

The plugin is used to display a specific page in the welcome iframe of the dashboard. It works well in the native language (French) but does not work in English. The page as an English version created and is private.

Solution: Change the get_home_url()... for apply_filters( 'wpml_permalink', '/divi-dashboard-welcome-screen' ); in the plugin's code (in iframe) and the welcome page will work in secondary language too.

This topic contains 8 replies, has 2 voices.

Last updated by bernardL-9 2 weeks, 1 day ago.

Assigned support staff: Radu.

Author Posts
October 5, 2019 at 3:14 pm #4700609

bernardL-9

I have installed a plugin (Divi Dashboard Welcome) that doesn't seem to support WPML is the way it is configured on my site.

The plugin is explained at the following link: hidden link

The plugin is used to display a specific page in the welcome iframe of the dashboard. It works well in the native language (French) but does not work in English. The page as an English version created and is private.

After some investigation I realized that they use the function get_home_url() then append the name of the page in order to create the page's URL:

-For the French the page link created is: "hidden link"
-For the English the page link creates is: "hidden link" which is wrong. The /?lang=en should be placed at the end.

As a work around, I have used the function get_site_url() instead. This forces the French page to show in the English version of the welcome iframe (removes the /?lang=en string).

I also realized that if I used the folder option (/en/) to select language I would not have this problem.

Is there any hook I could add to my site so the English page would show up properly in the welcome iframe?

The site is: hidden link but you need to get logged in to see the problem.
I have attached a few pictures showing part of the source code and the resulted HTML when the problem occurs.

Thanks,

October 5, 2019 at 3:28 pm #4700685

bernardL-9

Just want to add to the previous post.
The get_site_url() would only work on a site that is installed to the root. It was working on a test local site of mine. But the online site is installed on a sub folder (/wp).
Thanks,
Bernard

October 5, 2019 at 4:20 pm #4700789

bernardL-9

OK, just for the record. I have tried to change the URL format for folder (/en/) and it creates a double slash which I guess could be removed with a RedirectMatch as explained here: hidden link

Bernard

October 6, 2019 at 4:38 pm #4702875

bernardL-9

I did a bit of homework and found a workaround. I have changed the get_home_url()... for apply_filters( 'wpml_permalink', '/divi-dashboard-welcome-screen' ); in the plugin's code - see picture attached.

In short the question is:
-For me: how to implement this by avoiding the modification of the plugin's php so it is not overwritten upon next update?
-For the plugin's author: how to implement this function so WPML would be able to find the proper path when in English mode in the dashboard?

October 7, 2019 at 7:15 am #4704931

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Bernard,

Thank you for reaching out the WPML support!

You did a great job checking this out and finding a way to make things work fine. Well done!

As I can see, this Divi Dashboard Welcome plugin is not created by the Divi team (it's actually the first time to hear about this plugin). The fix you found is actually the right way to do it. You're using the hook to make things work based on the language URL format.

Now, you'll have to reach out the Divi Dashboard Welcomeauthor and ask him to add this change to the plugin. This way, the changes will be available on future updates too and you won't need to do the same change again. I'm afraid that this change can only be done on the Divi Dashboard Welcome plugin side.

You can reach out the plugin author and if he's asking for any help from our side, I'll be happy to jump in and have a look.

Thanks,
Radu

October 7, 2019 at 11:21 am #4706549

bernardL-9

Thanks Radu.
If someone who's not using WPML would install that plugin, would it cause a problem applying the wpml_permalink filter?

October 7, 2019 at 12:07 pm #4706987

bernardL-9

I just tried and it works, but would like to have a confirmation before closing the ticket.
Thanks,
Bernard

October 8, 2019 at 8:19 am #4713097

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Bernard,

Adding that apply_filters part won't affect the functionality of the plugin, even if WPML is not installed or active. That's just creating a filter so any piece a code can hook to it. If WPML is not available on the website, there won't be anybody to hook to that filter so nothing happens.

Thanks,
Radu

October 8, 2019 at 11:28 am #4714719

bernardL-9

My issue is resolved now. Thank you!