[wp-trac] [WordPress Trac] #16541: get_search_form() ignores $echo argument if searchform.php exists

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 25 17:49:58 UTC 2011


#16541: get_search_form() ignores $echo argument if searchform.php exists
--------------------------+------------------------------
 Reporter:  kawauso       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Template      |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by apljdi):

 I agree. The current design of get_search_form() is very strange. The echo
 parameter is present but only works with the default content. One solution
 is the output buffering as in the patch above, but I agree with the
 sentiment that it is a waste of resources. A workaround is to pass the
 form through the get_search_form filter but again, that is a waste of
 resources as get_search_form() will look for, and possibly require, a file
 only to have it essentially discarded in favor of the form passed through
 the filter. My suggestion is to drop the file search and include
 altogether and pass the form only via the filter. My only concern is that
 this method could be awkward with large and complicated search forms.

 Feedback?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16541#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list