-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix invalid HTML structure on the widgets screen #24866
Conversation
Size Change: +256 B (0%) Total Size: 1.17 MB
ℹ️ View Unchanged
|
Don't be discouraged by failing test - it's just a lint issue, I'll fix it tomorrow morning. |
The failing test says:
Later edit: didn't see your comment @adamziel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works as described. Why do you say "This solution is not awesome" @adamziel , the dynamic_sidebar_params hook seems the right choice.
This does not affect the front-end in any way.
Does it make sense to output the rendered Search block at all? What does submitting the Search form do? More generally, does it make sense to render any block on In #24503, to get around this exact problem on |
@noisysocks It could work! I'm going to merge this PR regardless to at least have a correct HTML structure and then I'm going to spin a one like you just mentioned. |
Description
By default every widget on the legacy screen is wrapped with a
<form>
.https://github.com/WordPress/wordpress-develop/blob/master/src/wp-admin/includes/widgets.php#L205
This means that you can sometimes end up with invalid HTML.
<form>
inside a<form>
. Firefox helpfully highlights the invalid HTML.Courtesy of @noisysocks #24290 (comment)
This solution is not awesome, but it's okay. I believe that's what this filter and dynamic options were invented for anyway. Since there is no real form when the widget is also a block, this PR also hides the save button for such widgets.
How has this been tested?
form
inside aform
.Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: