Skip to content

Instantly share code, notes, and snippets.

@apsolut
Last active September 4, 2024 17:51
Show Gist options
  • Save apsolut/8893afaee3ae65d3eed9b41f550b59bd to your computer and use it in GitHub Desktop.
Save apsolut/8893afaee3ae65d3eed9b41f550b59bd to your computer and use it in GitHub Desktop.
WPEngine
<?php
// Sites:
$production_name='INSTALL_PRD';
$staging_name='INSTALL_STG';
$development_name='INSTALL_DEV';
// Check if PWP_NAME is set
if (defined('PWP_NAME')) {
// Create a variable from the PWP_NAME define
$wpeenv = PWP_NAME;
// Set the environment type for production
if ($wpeenv == $production_name) {
define( 'WP_ENVIRONMENT_TYPE', 'production' ); }
// Set the environment type for staging
if ($wpeenv == $staging_name) {
define( 'WP_ENVIRONMENT_TYPE', 'staging' ); }
// Set the environment type for development
if ($wpeenv == $development_name) {
define( 'WP_ENVIRONMENT_TYPE', 'development' ); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment