-
Notifications
You must be signed in to change notification settings - Fork 28
Allow filtering of the environment labels and their meta data #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
fabiankaegy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this approach! :) Much nicer API interface to work with :)
|
Thanks @claytoncollie, this looks great. We would also like to add additional environments and control the environment type.
That works well.
In
This (or a filter elsewhere) will allow us to customise environments. |
The environment type can be set by a wp-config definition
Like I said above, this value is set in the wp-config file with https://developer.wordpress.org/reference/functions/wp_get_environment_type/#description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the Environment Indicator feature to use a filterable configuration system and inline CSS injection, eliminating the external CSS file dependency and making the feature more customizable for developers.
Key Changes:
- Introduced
tenup_experience_environmentsfilter for customizing environment labels, icons, and colors - Converted from external CSS file to inline styles injected via PHP
- Replaced CSS pseudo-elements with Dashicons classes in HTML markup
Reviewed changes
Copilot reviewed 3 out of 24 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| includes/classes/AdminCustomizations/EnvironmentIndicator.php | Refactored to add filterable configuration system, inline CSS generation, and Dashicons integration |
| assets/css/admin.css | Removed environment indicator styles (now handled inline) |
| README.md | Added documentation for the new tenup_experience_environments filter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@darylldoyle The Copilot feedback seems reasonable. Should I proceed? |
|
@claytoncollie if you have the time, that'd be awesome, thanks 🙂 |
742a3a3
darylldoyle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work here!
Description of the Change
This PR refactors the Environment Indicator feature to be more flexible and maintainable by introducing a filterable configuration system and converting it to a 100% PHP solution.
Key Changes:
tenup_experience_environmentsfilter allowing developers to customize environment indicator labels, icons, background colors, and text colors for the four supported WordPress environment types (production, staging, development, local)environment-indicator.css) to inline CSS injected via PHP in the document head, eliminating the need for a separate CSS file::beforepseudo-elements with Unicode characters to WordPress Dashicons classes directly in HTMLBenefits:
Verification Steps:
Closes #175 and replaces #176
How to test the Change
Basic functionality test:
WP_ENVIRONMENT_TYPEconstant to each of:production,staging,development,localFilter customization test:
functions.phpChangelog Entry
Credits
Props @claytoncollie
Checklist: