Skip to content
This repository was archived by the owner on Apr 22, 2021. It is now read-only.

WPML compatibility? #73

Open
ghost opened this issue Feb 20, 2020 · 2 comments
Open

WPML compatibility? #73

ghost opened this issue Feb 20, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 20, 2020

Describe the bug
Menu links are not changed, they are still showing the default language links instead of the newly added domain.

To Reproduce
Steps to reproduce the behaviour:

  1. Have WPML installed
  2. Use different domains for each language
  3. Activate Plugin
  4. Add another Domain

Expected behaviour
Links in the Main Navigation Menu to change according to the new domain added.

Screenshots
Get back to me if needed.

Environment:

  • PHP version: 7.3
  • WordPress version: 5.3.2
  • Plugin version: 1.0.5

Additional context
I am using WPML and have a different domain for each language:

  • domain.uk
  • domain.de
  • domain.bg
    and so on.

It would be great if I could use the permalinks with the new domain:

  • domainIjustAddedWithThisPlugin.com/?p=123456

this is only possible with the default language, not other domains set in WPML

@straube
Copy link
Owner

straube commented Feb 21, 2020

Hey @jayhybrid

This plugin is not compatible with WPML nor any other plugin that relies on domain changes to work. This is a known issue for a while but there is no fix on the way. You can follow some discussions in here.

Yet, in case you simply need to have 1 domain per language, WPML handles that for you alone. There is no need to use Multiple Domain plugin. You just have to set it to use language in domains.

If you want more than one domain per language, this is an old tutorial from WPML that might work for you.

@ghost
Copy link
Author

ghost commented Feb 24, 2020

Hey @straube

Thanks for the info. The discussion you sent me seems to be quite promising, am I missing something here? Could this not be tested [and applied]?

`// Show alias at Homepage as well
function filter_wpml_active_languages( $home_url) {
if (class_exists('MultipleDomain')) {
$multipleDomain = MultipleDomain::instance();
}
return $multipleDomain->fixUrl($home_url);
};

// add the filter
add_filter( 'wpml_url_converter_get_abs_home', 'filter_wpml_active_languages', 10 );`

This may not be going global according to WPML but seems to be a quick fix until then.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant