Polylang incompatible with Development Site using db.php
-
I have a public site that is being worked on. I keep a local copy of WordPress to develop the theme and other files. This setup works great and I have it working for many wordpress sites. See this link for how I did it.
In a nutshell, the above site leads you to add two filters (pre_option_home and pre_option_siteurl) that replace the url with the dev url. That way, the database gets the right URL (the live site) written to it and the dev site (my local computer) see links and whatnot linking to the local site.
This all fails when this Polylang option is on:
The language is set from the directory name in pretty permalinks
Example: https://local-dev-site/blog/en/my-post/That is, if my url is:
https://local-dev-site/blog/some-post-name/
My code for a dev site vs a live site works fine.If I turn that option on, the URL SHOULD BE:
https://local-dev-site/blog/es/some-post-name/But instead it rewrites to:
https://live-site-domain.com/blog/es/some-post-name/I believe polylang is seeing the /en/ (or /es/) and redirecting using something that my pre_option_home or pre_option_siteurl isn’t catching… thus the redirect goes to the true URL (instead of my local copy).
To solve this, I think either polylang needs to be tweaked to use something else to get the url or my db.php needs to be changed to add something other than pre_option_siteurl or pre_option_home.
Anyone have an idea?
- The topic ‘Polylang incompatible with Development Site using db.php’ is closed to new replies.