home_url filter not working for site home address
-
Hello all
thanks again for your plugin. We’re having issues with the value returned by Polylang
home_url
filter in a particular scenario. A third-party theme (which up to now works great with Polylang) builds a menu with the icon logo inside an anchor to the site home address.Polylang plugin generally returns the right URLs, inserting the language directory when needed (e.g. https://my-domain/my-wp-path/en/my-sub-path/). But for an anchor to the home, it just returns the plain home address, without language directory. So, instead of https://my-domain/my-wp-path/en/, we get https://my-domain/my-wp-path/.
To build the home address the theme file invokes
home_url()
, without any parameter. We checked Polylang code and the corresponding filter gets actually invoked:home_url($url, $path)
inpolylang\frontend\frontend-links.php
.For some reason, the filter action runs through its final return statement:
return empty($ok) ? $url : ...
and returns the home URL without any language directory.
For completeness: WordPress 3.9.1, Polylang 1.6.
Could you please help us fixing this behaviour?
Thanks
- The topic ‘home_url filter not working for site home address’ is closed to new replies.