Opened 2 years ago
Closed 2 years ago
#45968 closed feature request (invalid)
extend get_search_form() to allow placeholder text to be passed into method
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | |
Component: | Themes | Keywords: | has-patch reporter-feedback |
Focuses: | accessibility | Cc: |
Description
Desire:
get_search_form('Search here...');
Output
<input type="submit" id="searchsubmit" value="Search" placeholder="Search here...">
To allow the developer to manually set a placeholder text when invoking the native wp search form. This removes the need for unnecessary JS, php methods to override, or creating a searchform.php file just to set a placeholder text.
Attachments (3)
Change History (13)
#2
@
2 years ago
- Component changed from General to Themes
- Focuses accessibility added
- Keywords reporter-feedback removed
Related discussion: #40462
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
2 years ago
#6
@
2 years ago
- Keywords reporter-feedback added
Worth noting this function prints out also a visually hidden label for the search input:
<label> <span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span> ...
When changing the placeholder, the visually hidden label should still make sense, which makes things a bit more complicated.
@gege90ererefeee any more use cases other than having the ability to change Search...
to Search here..
?
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
2 years ago
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
2 years ago
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
2 years ago
#10
@
2 years ago
- Keywords 2nd-opinion removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Discussed during today's accessibility bug scrub and agreed to close this ticket. Also, no reporter feedback in a month. Discussion can always continue on closed tickets :)
Hello @gege90ererefeee,
Many thanks for your great idea, I attached a patch with this.