Opened 4 months ago
Last modified 4 months ago
#58484 new defect (bug)
Always use wp_get_environment_type in all sources
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.3 |
Component: | Bootstrap/Load | Keywords: | has-patch |
Focuses: | Cc: |
Description
This is a follow up on https://core.trac.wordpress.org/ticket/55741
where we need to have just a single function to be called which determines the environment type.
As wp-admin/includes/class-wp-debug-data.php is already using:
$environment_type = wp_get_environment_type();
and later on:
this happens
// Check WP_ENVIRONMENT_TYPE. if ( defined( 'WP_ENVIRONMENT_TYPE' ) && WP_ENVIRONMENT_TYPE ) { $wp_environment_type = WP_ENVIRONMENT_TYPE; } else { $wp_environment_type = __( 'Undefined' ); }
so this is not the same as what happens at wp_get_environment_type();
So this ticket is where we remove that lines of code.
Attachments (3)
Change History (7)
This ticket was mentioned in Slack in #core by ramonfincken. View the logs.
4 months ago
#2
@
4 months ago
a small update on this, checked with @SergeyBiryukov
this code is accurate meaning it is shown in the tools -> constants.
I will just show the PHP constant which does not have a need to call wp_get_environment_type()
However ... if you have defined WP_ENVIRONMENT_TYPE and it is empty this code will show "Undefined" while it is actually defined indeed.
patch.58484.20230608.1.diff