Skip to content

Commit

Permalink
feat(theme): use wp_get_environment_type for WP_ENV (#298)
Browse files Browse the repository at this point in the history
* fix(EnvironmenVariable): use wp 5.5 core function

details: https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/

* revert(componentLogServer)

* fix(EnvironmentVariables): wp 5.5 core compatibilty

* fix(EnvironmentVariables): removed lint errors
  • Loading branch information
timohubois authored Aug 31, 2020
1 parent 789098e commit 5bf90db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
require_once __DIR__ . '/vendor/autoload.php';

if (!defined('WP_ENV')) {
define('WP_ENV', 'production');
define('WP_ENV', function_exists('wp_get_environment_type') ? wp_get_environment_type() : 'production');
} elseif (!defined('WP_ENVIRONMENT_TYPE')) {
define('WP_ENVIRONMENT_TYPE', WP_ENV);
}

// Check if the required plugins are installed and activated.
Expand Down

0 comments on commit 5bf90db

Please sign in to comment.