-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add ability to set per widget area defaults #87
Comments
I spent some time with this and it doesn't seem possible with a pure-PHP/JS method using official WP APIs at the moment. The issue is that:
I can think of other ways to do this with JS, but they are hacks, rather than methods that use official APIs. We'd also need an alternative JS method for the Customizer. I'll leave this open for now, though, in case others have new ideas or I think of something else. |
I looked into this a bit too, and I agree with your assessment. There are ways to make it happen, but they do feel like hacks. Under Appearance > Widgets, when you drop a widget into a widget area, an AJAX POST request runs. It contains the new widget's ID and sidebar location. We could tie into that and populate the form dynamically, and as you noted it would require something different in the Customizer. I love the idea and think setting default values intelligently as @dreamwhisper describes would be a very nice user experience and set us apart from others in this area. I think it's worth exploring deeper as time allows. |
Thanks for taking the time to look into this too @mindctrl, and for your notes. Leaving as needs-research for now in the hope we can revisit at some stage. |
We previously added the ability to set defaults for widget settings so themes could specify the expected settings rather than add custom CSS.
However, different widget areas may need different defaults depending on background color, space, etc.
This issue is to investigate the feasibility of adding defaults for different widget areas.
Preferably:
The text was updated successfully, but these errors were encountered: