[wp-trac] [WordPress Trac] #50896: Add filters to wp_get_environment_type()
WordPress Trac
noreply at wordpress.org
Tue Aug 11 16:35:13 UTC 2020
#50896: Add filters to wp_get_environment_type()
-------------------------+------------------------------
Reporter: crstauf | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by crstauf):
Replying to [comment:4 Clorith]:
> I'm not sure I get the underlying problem here, wouldn't it be _easier_
to define the `WP_ENVIRONMENT` constant on your development site, than
implementing a filter?
@Clorith If there were only one development, staging, and production site,
a constant works: set it once and forget about it. However, in a workflow
where there can be multiple development sites (think multiple developers
creating local instances) absolutely ensuring the creation of a constant
in `wp-config.php` before any request is made to the local instance is
(unfortunately) impossible (at least has been in my experience).
The advantage of an mu-plugin is that it would be easily distributed with
the codebase (due to its location within `wp-content` directory), and
would thus near-absolutely ensure the environment type of "development".
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50896#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list