froger-me / wp-remote-users-sync

Synchronise users across WordPress websites
GNU General Public License v3.0
71 stars 34 forks source link

problem with redirects when using multiple languages #58

Open lcdservices opened 2 years ago

lcdservices commented 2 years ago

We're using Weglot for language translation -- currently just English (default) and Spanish. When a user switches to Spanish, that prepends '/es' to the URL path -- e.g. "https://mysite.org/es/my-account" -- which should then persist as the user navigates the site.

We are finding that on login, logout, and account creation, we're losing the language, so it reverts to English. This is because those actions run through the WPRUS synchronization process before sending the user to the intended destination, and the language selection is lost. We've tried using the wp_redirect hook to capture the redirection but it appears WPRUS handles that redirection in a way that bypasses that filter.

I reviewed and tested some of the WPRUS hooks, but haven't found any that seem to provide access to the post-sync redirection. Any suggestions?