Open

Symptoms

This issue will occur when those 3 conditions are true:

  • The site uses “Different languages in directories” as a language format
  • The “Use directory for default language” option is checked
  • The site is NOT installed in a subdirectory, e.g. “http://mysite.com”

    Then the REST API is not available under URL “http://mysite.com/YOUR_DEFAULT_LANG/wp-json” but is still visible under “http://mysite.com/wp-json”.

Workaround

In order to temporary fix it, you will need to modify WPML_URL_Converter_Subdir_Strategy::is_use_directory_for_default_lang_enabled in this way:

public function is_use_directory_for_default_lang_enabled() {
   return $this->use_directory_for_default_lang;
}

Do not apply this temporary fix if your site is installed in a subdirectory: e.g. “http://mysite.com/dev”. In such a case, the current code works correctly.

We are working on a permanent fix and it’ll be included in one of our next versions.

Leave a Reply

Please leave here comments about this page only.
For technical support and feature suggestions, head to our forum. We are waiting there!

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>