[wp-trac] [WordPress Trac] #19579: Make get_search_form() more filterable/extensible
WordPress Trac
wp-trac at lists.automattic.com
Fri Dec 16 16:09:06 UTC 2011
#19579: Make get_search_form() more filterable/extensible
-------------------------------------+------------------------------
Reporter: chipbennett | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Template | Version: 3.3
Severity: normal | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+------------------------------
Comment (by toscho):
Replying to [comment:2 chipbennett]:
> I'm open to direction on this. Basically, I just incorporated #16538.
What's the best approach?
For a simple search field, the best approach is to leave the
`placeholder``out. The UI has to work without `placeholder`anyway, because
not all browsers support it. You cannot
[http://stackoverflow.com/a/2610741/299509 style the `placeholder`] in all
browsers – and risk bad contrasts.
`placeholder` may be useful for difficult forms (taxes etc.), but a
clearly labeled search form doesn’t need it. The filter for additional
attributes is good enough.
> > There should be a space between the input elements.
> >
>
> Isn't there? I'm imploding the atts arrays with spaces before outputting
them in the HTML markup.
{{{
$form .= '<label for="' . esc_attr( $args['id'] ) . '" ' .
$label_atts . '>' . esc_attr( $args['label_text'] ) . '</label>';
$form .= '<input name="' . esc_attr( $args['id'] ) . '" id="' .
esc_attr( $args['id'] ) . '" ' . $input_atts . ' />';
$form .= '<input id="' . esc_attr( $args['form_id'] ) . '" ' .
$submit_atts . ' />';
}}}
''Search for:SearchSearch'' :)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19579#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list