Skip to content

Instantly share code, notes, and snippets.

@otakupahp
Created June 15, 2021 16:34
Show Gist options
  • Save otakupahp/27c2f50e9d8ccc41a97adec2b61905f7 to your computer and use it in GitHub Desktop.
Save otakupahp/27c2f50e9d8ccc41a97adec2b61905f7 to your computer and use it in GitHub Desktop.
Add docker environment to WP
<?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