Skip to content
This repository has been archived by the owner. It is now read-only.

Update the colorscheme function to set the hue correctly #512

Merged

Conversation

@brentswisher
Copy link
Contributor

@brentswisher brentswisher commented Nov 8, 2018

The color scheme customizer function currently takes in a string, either "default" or "custom" as it's 'to' argument, but tries to set the hue to that actual value. This PR updates that to grab the current custom hue or use the default hue instead based on the to value passed in, fixes #468

Ideally, we could pull the default hue from somewhere without hardcoding it, but I couldn't find anywhere that it was stored. I thought "wp.customize.settings.values.colorscheme_primary_hue" might work, but that was just the last saved value, not the true default, so I hard coded it.

(Wordpress.org username is also brentswisher)

rwx2ioaeo3

brentswisher added 2 commits Nov 8, 2018
… string being passed in, instead of to the actual string.
…d coded default hue, the old way stored the last published color, not the actual theme default
@kjellr kjellr requested a review from allancole Nov 8, 2018
@kjellr kjellr added this to the RC1 milestone Nov 8, 2018
@kjellr
Copy link
Collaborator

@kjellr kjellr commented Nov 8, 2018

Thanks @brentswisher! I can confirm that this works. 👍

cc @allancole for a review too.

Copy link
Collaborator

@allancole allancole left a comment

Yup, this looks great! Thanks @brentswisher 👍

@allancole allancole merged commit 031c4f1 into WordPress:master Nov 8, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@brentswisher brentswisher deleted the brentswisher:fix/customizer-color-scheme-preview branch Nov 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants