-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
[request] wpjson.settings
callback fn
required to return passed theme
instance; missing generated theme.json
parts otherwise
#2168
Comments
wpjson.settings
callback fn
requires theme
being returned by functionwpjson.settings
callback fn
required to return passed theme
instance
wpjson.settings
callback fn
required to return passed theme
instancewpjson.settings
callback fn
required to return passed theme
instance, missing generated theme.json
parts otherwise
wpjson.settings
callback fn
required to return passed theme
instance, missing generated theme.json
parts otherwisewpjson.settings
callback fn
required to return passed theme
instance; missing generated theme.json
parts otherwise
I'm willing to hear out arguments for the behavior being different, but this function is working as intended (and as documented). It gives you the object and asks you to return something: export interface Mutator {
(
json:
| Partial<Theme.GlobalSettingsAndStyles['settings']>
| Container<Partial<Theme.GlobalSettingsAndStyles['settings']>>,
):
| Partial<Theme.GlobalSettingsAndStyles['settings']>
| Container<Partial<Theme.GlobalSettingsAndStyles['settings']>>
}
interface settings {
(
input?:
| Mutator
| Container<Partial<Theme.GlobalSettingsAndStyles['settings']>>
| Partial<Theme.GlobalSettingsAndStyles['settings']>
| boolean,
raw?: boolean,
): this
} I think it's more confusing for this function to not use what is returned as a value. And it's pretty easy to always return a value with arrow fns and the container interface: bud.wpjson.settings(theme => theme
.set('color.custom', false)
.set('color.customDuotone', false)
) Regardless, bud.wpjson
.set(`settings.color.custom`, false)
.set(`settings.color.customDuotone`, false)
.set(`settings.color.customGradient`, false)
.set(`settings.color.defaultDuotone`, false) |
wpjson.settings
callback fn
required to return passed theme
instance; missing generated theme.json
parts otherwisewpjson.settings
callback fn
required to return passed theme
instance; missing generated theme.json
parts otherwise
Message to comment on stale issues. If none provided, will not mark issues stale |
Agreement
Describe the issue
The
wpjson.settings
callback function has to return thetheme
instance which it got passed as argument,as otherwise parts of generated
theme.json
will be missing, and not just the parts added after the callback function.Expected Behavior
No missing parts of generated
theme.json
, even if the callback function does not return thetheme
instance.Actual Behavior
Parts of
theme.json
is missing when the callback function does not return thetheme
instance:Steps To Reproduce
bud
configuration.bud
build. (Optional: Keep/copy generatedtheme.json
for later comparison with a newly generatedtheme.json
).bud
config awpjson.settings
invocation with a callback function that does not return thetheme
instance that was passed to it as argument:bud
build, note that parts of newly generatedtheme.json
are missing now.version
6.9.1
Logs
Configuration
Relevant .budfiles
No response
The text was updated successfully, but these errors were encountered: