#48033 closed enhancement (fixed)
Add a register_sidebar_defaults filter
Reported by: | powerbuoy | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 5.2.3 |
Component: | Widgets | Keywords: | good-first-bug has-patch |
Focuses: | Cc: |
Description
Being able to change the register_sidebar defaults on a theme basis would be excellent for those of us who don't render our widgets in a list.
Today we have to specify before_widget and after_widget on every call to register_sidebar, being able to do this instead would be an improvement:
<?php add_filter('register_sidebar_defaults', function ($defaults) { $defaults['before_widget'] = '<article id="widget-%1$s" class="%2$s">'; $defaults['after_widget'] = '</article>'; return $defaults; });
Attachments (2)
Change History (7)
Note: See
TracTickets for help on using
tickets.
Introduced new filter <code>register_sidebar_defaults</code>