I am expecting it to return home_url (example.com).
On main blog, the language menu item return proper front-page site url for other blog translation. But, on second blog, the language menu item returned for front-page of main blog is site_url (example.com/wp).
I was able to fix this by changing get_site_url to get_home_url here
Is this the proper behavior? Should the url returned be home_url instead of site_url?
I am using Roots' project structure Bedrock
Hello, I just noticed that the error reported here happens when main blog is set to a static front-page and the second blog is set to 'latest posts'. After setting both with a static front-page, both front-page returned are OK in the language nav item. So, I don't know if this is worth investigating further as most installation will have the same settings (static vs latest posts) for the front-page. If I can be of further help, I'd be more than happy to report back here.
I had scheduled this issue for today already. :)
Even if you're right, the current behavior is not 100% correct, still.
For front-end requests/URLs, we should be using [get_]home_url() (instead of [get_]site_url()). This is not only the case in the location you linked to, but also in other locations.
I will handle this in a feature branch, so we both can test this before I will merge this.
Use (get_)home_url() for front-end requests/URLs. #247
Closed with 0c3de80.
Use get_home_url() for nav menu links. #206 #247