Refactor so we no longer save customizer colors with # symbols#204
Merged
kimcoleman merged 16 commits intostrangerstudios:memberlite-7-0from Feb 7, 2026
Merged
Conversation
… and using in header_output instead
…em in the database
…in updates.php to save colors without the hashes
…not pulling colors with undefined vars because they're using WordPress vars. Will test some more to ensure we really need this.
…ion script on a legacy scheme, there's some weirdness happening in the <head>. Will record a loom...
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes how Memberlite stores Customizer hex colors by saving them without a leading # (matching WordPress core behavior), and updates the theme’s output/migration logic to keep legacy schemes working during upgrades.
Changes:
- Refactors default + legacy color scheme definitions to store hex values without
#. - Updates Customizer preview/control JS to add
#only when needed for CSS/pickers. - Adds/adjusts an update migration to trim
#from stored theme_mod color values.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| js/customizer.js | Ensures live-preview CSS variable updates use hash-prefixed colors and can add missing vars to :root. |
| js/customizer-controls.js | Adjusts scheme→picker updates to handle scheme colors that no longer include #. |
| inc/updates.php | Updates migration logic to trim hashes when writing theme_mod color values. |
| inc/deprecated.php | Removes # from legacy scheme definitions. |
| inc/defaults.php | Removes # from modern scheme/default color values. |
| inc/customizer.php | Updates sanitization/output to work with no-hash storage and reworks the CSS var output. |
| functions.php | Minor doc comment whitespace change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RachelRVasquez
added a commit
to RachelRVasquez/memberlite
that referenced
this pull request
Mar 12, 2026
…gerstudios#204) * added back in code to trigger color overrides for the PMPro CSS vars, and using in header_output instead * formatting fix * in the process of removing hashes from all colors so we don't save them in the database * removed hashes from legacy scheme defs too, and updated the function in updates.php to save colors without the hashes * it seems like we do need the WP prefixed vars? Noticed some elements not pulling colors with undefined vars because they're using WordPress vars. Will test some more to ensure we really need this. * all colors save into the database without hashes, need to test migration script on a legacy scheme, there's some weirdness happening in the <head>. Will record a loom... * brought over Kim's changes * formatting * remove prefixed vars in header_output * rebased branch * added back in where we're checking PMPRO_VERSION * try to align comments in set_customizer_color_settings * try to align comments in set_customizer_color_settings * tweak to if else in the memberlite_migrate_colors_to_theme_mods for checking existing values vs new ones * put back a change I applied from co-pilot, better this way * Spaces to tabs --------- Co-authored-by: Kim Coleman <kim@strangerstudios.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
WordPress does not store colors (hex values) with the #, so to eliminate the need for conditionals sprinkled throughout to either remove or add hashes, we thought it made more sense to refactor to WordPress standards. Also includes a migration function in updates to keep color schemes intact/consistent.
How to test the changes in this Pull Request:
devbranch where we still have our legacy color schemes.wp_optionstable, ranUPDATE wp_options SET option_value = '0' WHERE option_name = 'memberlite_db_version';Known Issues
There is a known issue with some of the WordPress preset vars being undefined. We'll be tackling that on a separate branch.
Other information:
Changelog entry