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
merged 3 commits into from Nov 8, 2018

Conversation

Projects
None yet
3 participants
@brentswisher
Copy link
Contributor

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 some commits Nov 8, 2018

Update the colorscheme function to set the hue correctly based on the…
… string being passed in, instead of to the actual string.
Replace wp.customize.settings.values.colorscheme_primary_hue with har…
…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

This comment has been minimized.

Copy link
Collaborator

kjellr commented Nov 8, 2018

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

cc @allancole for a review too.

@allancole
Copy link
Collaborator

allancole left a comment

Yup, this looks great! Thanks @brentswisher 👍

@allancole allancole merged commit 031c4f1 into WordPress:master Nov 8, 2018

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.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.