Closed nlemoine closed 10 years ago
Interesting! I will check that. Thanks for the message.
I have the same problem, is there a way to fix this?
You are using the same approach? You have the WP-core files in a subdirectory?
Yes I have the WP-core files in a subdirectory. I've already changed the [get_current_link] but that didn't function.
The wrong link url is shown for the current blog if I understood the problem, right? There is - at the moment - no workaround for this special kind of installation.
Do you expect one in the near future?
Yes - for sure - if there is a solution.
Did you try the solution I mentionned ? You just have to replace site_url() by home_url(), that's why these two different functions exists.
Do you me to submit a pull request ?
@nlemoine Before this I want to be sure if this is an issue of the Multisite Language Switcher and not something which comes with the "WordPress in a subdirectory"-approach.
But you can write some tests to help on this. Read on here:
Here is my fix:
Change line 140 of the MslsOptions.php file:
before: return( '' != $postlink ? $postlink : site_url() );
after: return( '' != $postlink ? $postlink : home_url() );
Voila ;)
@sasselin Please look at the actual developer version here at GitHub: https://github.com/lloc/Multisite-Language-Switcher/commit/19a15eba9d475927f53b321ed8ab129c844e8a69 because this is already in there.
Was just about to report this as well. Posted it onto the WP.org support forum.
Will this be added in the next production version? AKA is it safe to be changing these 2 lines in the plugin myself for now?
Yes, it is already in the code as I said above. ;)
Hi,
I'm using the
the_msls()
function to ouput the switch language links.I noticed that it's getting the wrong URL with the directory structure I'm using (WP core files in a subdirectory, see https://github.com/bueltge/WordPress-Starter).
The main blog URL is http://mydomain.com/wp whereas the home of this blog is http://mydomain.com/
This is because the
get_current_link
function in MslsOptions.php file is taking thesite_ur
l function instead of thehome_url
function.I think your plugin should use
home_url('/')
to retrieve the current link.What do you think ?