Skip Navigation

Resolved

Resolved in: 4.4.5

Overview of the issue

Depending on your permalink structure, REST API endpoints will miss a slash in the URL or have an extra slash.

Workaround

Our developers are checking the bug to devise a permanent fix.

As a workaround, please go to SettingsPermalinks and add the missing trailing slash to your custom permalink structure.

Or you can apply the following patch:

Note: if you have any trouble applying the current patch, please open a support forum ticket and we’ll help you with that.

Edit the file sitepress-multilingual-cms/classes/url-handling/converter/strategy/class-wpml-url-converter-subdir-strategy.php on line 57 and replace:

return $this->convert_url_string( $url, $sitepress->get_current_language() );

By:

$matchTrailingSlash = $url[ strlen( $url ) - 1 ] === '/' ? 'trailingslashit' : 'untrailingslashit';
return $matchTrailingSlash( $this->convert_url_string( $url, $sitepress->get_current_language() ) );

6 Responses to “REST API endpoint issue when permalink structure is missing a final slash”

  1. Hello,
    Where can I update the permalink structure so that the WPML works with Elementor?
    I’ve tried and it doesn’t seem to work. Once I activate the WPML plugin ELementor stops working.