WordPress.org

Make WordPress Core

#45968 closed feature request (invalid)

extend get_search_form() to allow placeholder text to be passed into method

Reported by: gege90ererefeee Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Themes Keywords: has-patch reporter-feedback
Focuses: accessibility Cc:
PR Number:

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)

45868_add_parameters.diff (1.7 KB) - added by sebastienserre 13 months ago.
45968-2.diff (1.6 KB) - added by sebastienserre 13 months ago.
drink some coffe and improve the patch!
45968.diff (1.8 KB) - added by mukesh27 13 months ago.
Updated Patch.

Download all attachments as: .zip

Change History (13)

#1 @sebastienserre
13 months ago

  • Keywords has-patch reporter-feedback 2nd-opinion added

Hello @gege90ererefeee,

Many thanks for your great idea, I attached a patch with this.

@sebastienserre
13 months ago

drink some coffe and improve the patch!

#2 @swissspidy
13 months ago

  • Component changed from General to Themes
  • Focuses accessibility added
  • Keywords reporter-feedback removed

Related discussion: #40462

#4 @pento
13 months ago

  • Version trunk deleted

@mukesh27
13 months ago

Updated Patch.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


13 months ago

#6 @afercia
13 months 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.


13 months ago

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


13 months ago

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


12 months ago

#10 @afercia
12 months 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 :)

Note: See TracTickets for help on using tickets.