-
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
Make sure $label_markup is always defined. #16189
Conversation
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.
Thanks for fixing 👍
It's important to note that the search input field should always be labelled. WordPress aims to produce semantic, web standards compliant, and accessible markup in the front end. This block should make sure there's a label. If developers want to visually hide the label (which is not recommended), then there should be an option or a fallback to a visually hidden label (with Input fields can be labelled in a few ways:
Seems to me the simpler, and more standard, option is the first one. A simple fallback could be:
|
Fixes #16188.
Description
Since
$label_markup
inrender_block_core_search()
is defined conditionally, it causes a PHP notice if there's no label provided.Making sure that the variable is always defined fixes the issue.
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: