Opened 15 years ago
Closed 14 years ago
#12163 closed defect (bug) (fixed)
Setup default widgets when installing
Reported by: | ryan | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 2.9.1 |
Component: | Widgets | Keywords: | needs-patch |
Focuses: | Cc: |
Description
A common source of confusion is how the default sidebar that is hard-coded for themes when no widgets are configured "disappears" entirely when go to the widget admin and adding a widget. What is displayed on the front should match what is displayed on the admin. Doing this in a back compat way for all themes is difficult, but we can at least setup some default widgets for the default theme so the out-of-the-box experience for a fresh install is better.
Attachments (2)
Change History (6)
Note: See
TracTickets for help on using
tickets.
The patch looks good, cleaned it a bit. Was thinking we could use
add_option()
so if somebody is re-running the install it wouldn't overwrite already defined widgets, but perhaps the expected behavior would be to overwrite them.We need to add support for default widgets to
register_sidebar
so theme authors can pre-register widgets there when the sidebar is empty instead of hard-coding them in the theme. That has to happen on the next page load after a theme is activated.Was thinking to drop most of the back-compat code in the widgets API and improve
register_sidebar
(there are several tickets about it) but perhaps that's better left for 3.1.