For example, instead of sending emails via Mailgun on my development site, I’ll conditionally load a small mu-plugin to deactivate the Mailgun plugin and test emails safely with Mailtrap (I’ll cover Mailtrap in more detail later). This is necessary to conditionally load code in different environments. We’ve used our own set of constants before and others have used the WP_ENV environment variable. There’s a lot to cover so although this post will have a tonne of information, it also features a good collection of links to other articles that dive deeper.ĭid you know that WordPress 5.5 introduces a way to set the environment type for a site? In the past developers had to roll their own method of setting the environment. In this post I’ll guide you through various ways to set up the dev environment, install WordPress locally, wrangle the database, debugging and lots in between. Running a WordPress dev environment for your sites is crucial to a productive and safe workflow as a developer. When running a WordPress website it’s best practice to at least run a local copy of the site so you can make changes without running the risk of completely ruining the live site.
0 Comments
Leave a Reply. |