-
Notifications
You must be signed in to change notification settings - Fork 279
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
Refactor config files #264
Conversation
Fixes #260.
We can retrieve the default color from the appearance config instead. We don't have getter functions to retrieve other preferences, so it seems unnecessary to have one for the colors alone.
Noting two potential improvements for the future (that each require changes in Genesis):
|
This allows them to be referenced inside the returned array, preventing a PHP warning.
config/appearance.php
Outdated
'color' => get_theme_mod( 'genesis_sample_accent_color', genesis_sample_get_default_color( 'accent' ) ), | ||
'color' => get_theme_mod( | ||
'genesis_sample_accent_color', | ||
$genesis_sample_default_colors['accent'] |
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.
Should this be defined earlier like the link color for consistency?
$genesis_sample_accent_color = get_theme_mod(
'genesis_sample_accent_color',
$genesis_sample_default_colors['accent']
);
config/appearance.php
Outdated
@@ -18,6 +27,7 @@ | |||
'default-button-bg' => $genesis_sample_link_color, |
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.
Doesn't have to be for this PR, but for each default-
here, they aren't always "default" once the colors are changed. Perhaps we should look at renaming these?
@dreamwhisper Thanks for your review. I like both changes you suggested and have updated this PR. |
This ensures widget areas get added.
Fixes #260.
child-theme-settings.php
instead of renaming it todefaults.php
as intended, because it's hard-coded and auto-loaded by Genesis: https://github.com/studiopress/genesis/blob/8899887473437ba5a0a017b0214da9e17a009677/lib/admin/onboarding/theme-activation.php#L53genesis_sample_get_default_color()
in favor of fetching the default colors from the config directly. (We don't have getter functions for other configuration data, so it seems unnecessary to have one for the colors.)