Created
June 15, 2021 16:34
-
-
Save otakupahp/27c2f50e9d8ccc41a97adec2b61905f7 to your computer and use it in GitHub Desktop.
Add docker environment to WP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Define a Docker environment constant with the value | |
| define( 'WP_ENVIRONMENT_TYPE', getenv_docker('WORDPRESS_ENV', 'local') ); | |
| /* | |
| * To use this, you should add a conditional | |
| * | |
| * ``` | |
| * if( wp_get_environment_type() === 'local' ) { | |
| * // your code | |
| * } | |
| * ``` | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment