Opened 3 years ago
Last modified 3 years ago
#55175 new enhancement
Widgets: Allow filtering args in `the_widget`
Reported by: | noisysocks | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Widgets | Keywords: | has-patch |
Focuses: | Cc: |
Description
Originally reported in https://github.com/WordPress/gutenberg/issues/36830.
---
### Description
currently it's not possible to change widgets before_title
from <h2>
to <h4>
when you use new gutenberg widgets environment and legacy widgets like nav_menu
it's calling the_widget
with $arg
without any apply_filter
in wp-includes/blocks/legacy-widget.php
### Step-by-step reproduction instructions
- Go to
/wp-admin/widgets.php
- add Legacy Widget - Navigation Menu
- Enter some title
- On frontend it will be rendered as
<h2>
but there is no way how to change it to something else, like<h4>
- no hook
### Screenshots, screen recording, code snippet
_No response_
### Environment info
_No response_
### Please confirm that you have searched existing issues in the repo.
Yes
### Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Adding a new
the_widget_args
filter tothe_widget
makes sense to me.