afragen / local-development

WordPress plugin to provide local development message for selected plugins/themes
GNU General Public License v2.0
24 stars 7 forks source link

Set WP_ENVIRONMENT_TYPE does't work for WP 5.5.1+ #14

Closed cheh closed 2 years ago

cheh commented 2 years ago

Unrortenantly, this feature doesn't work for WP 5.5.1+ if entirouments are configured on LocalWP .

Whenever I try to set environment type, it will be forced to local:

https://user-images.githubusercontent.com/2461627/184834490-8cf5c6c1-4b49-4571-b433-254b64b28e24.mov

But it works precisely for WP 5.5. I guess the issue is related to changes that were made in 5.5.1 for the wp_get_environment_type() function.

LocalWP: v6.4.2 OS: macOS PHP: 5.6

P.S. It would be great if WP < 5.5 were supported as well. It might be required to add the wp_get_environment_type() function with function_exists() for backward compatibility, but it seems not a bug deal :wink:

afragen commented 2 years ago

This is because LocalWP sets this constant in one of its startup files.

This plugin checks to see if the constant is defined and if it is it uses that value.

https://community.localwp.com/t/dont-define-wp-environment-type/24587