stefanomarra / wpml-ipstack-redirect

Wordpress WPML plugin that redirects users to their appropriate languages by utilizing third-party service ipstack.com
GNU General Public License v2.0
0 stars 0 forks source link

Having issues when about to change default language to anyother language from the default country location. #1

Open ayanrafa4 opened 4 years ago

ayanrafa4 commented 4 years ago

I've just tried the plugin and it works great, but having an issue which should be fixed. I'm explaining my problem. I've used two languages on my website. The default language is Bengali, and the other one is English. So the problem is when I try to switch the language from Bengali language location(Bangladesh) to English via manually from menu or sidebars or footer it's won't work. It again redirects to Bengali. This is not good. But everything except this works fine. Like outside of default location, I can switch manually also in En to Bn or Bn to En. I hope this will be fixed soon.

Thanks

stefanomarra commented 4 years ago

Hi @ayanrafa4, I will have a look at this issue asap

Thanks

stefanomarra commented 4 years ago

Hi @ayanrafa4 I added some filter hooks to control the redirect.

function redirect($url = null, $client_lang = null) {
   if ( apply_filters( 'WPML_IPStack_Redirect_should_redirect', true, $url, $client_lang ) ) {
      wp_safe_redirect( apply_filters( 'WPML_IPStack_Redirect_redirect', $url, $client_lang ) );
   }
}

Could you try and see if these hooks could maybe solve your issue?