[wp-trac] [WordPress Trac] #32528: Create a new search_form_content hook in get_search_form()

WordPress Trac noreply at wordpress.org
Wed Jun 17 13:59:43 UTC 2015


#32528: Create a new search_form_content hook in get_search_form()
-----------------------------+---------------------------------
 Reporter:  charlestonsw     |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  General          |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  ui, administration
-----------------------------+---------------------------------

Comment (by charlestonsw):

 Yes, I know about searchform.php which is great for templates. Not so
 great for plugins, especially widget-centric plugins.

 There are hundreds of widget plugins, and I bet themes using
 searchform.php as well, that are replicating MOST of the content generated
 by get_search_form only to add a new input field on the form.

 That creates a LOT of duplicate code and it opens the door to a lot of
 things breaking if a future release decides to augment the default search
 form, adding a new super-secure nonce as a security mechanism for example.

 Since the overhead of filter and hook processing is fairly minimal ,
 adding the hook and eliminating loading of hundreds of lines of duplicate
 code into memory may offset the execution cost.

 Meta inquiry:  How did you get the formatting around "searchform.php" and
 "get_search_form"?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32528#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list