From bbae368b81a30eb17d1797dd0af84cc0d7c6e3a5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 12 Mar 2013 10:25:08 +0000 Subject: [PATCH] Add $format argument to get_search_form() to allow HTML5 markup. props georgestephanis, lancewillett. fixes #15081. git-svn-id: http://core.svn.wordpress.org/trunk@23667 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 999aa0f2aa..36713a04a9 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -147,29 +147,34 @@ function get_template_part( $slug, $name = null ) { * * @since 2.7.0 * @param boolean $echo Default to echo and not return the form. + * @param string $format Which type to use for the search field. If set to 'html5' it changes to search input type and adds placeholder text. * @return string|null String when retrieving, null when displaying or if searchform.php exists. */ -function get_search_form($echo = true) { +function get_search_form( $echo = true, $format = 'xhtml' ) { do_action( 'get_search_form' ); - $search_form_template = locate_template('searchform.php'); + $search_form_template = locate_template( 'searchform.php' ); if ( '' != $search_form_template ) { ob_start(); - require($search_form_template); + require( $search_form_template ); $form = ob_get_clean(); } else { - $form = ''; } if ( $echo ) - echo apply_filters('get_search_form', $form); + echo apply_filters( 'get_search_form', $form ); else - return apply_filters('get_search_form', $form); + return apply_filters( 'get_search_form', $form ); } /**