Always respect $echo argument in get_search_form(). props garyc40, kawauso. fixes #16541.
git-svn-id: https://develop.svn.wordpress.org/trunk@23666 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a33ecb5f56
commit
f4a77a66b4
|
@ -154,17 +154,18 @@ function get_search_form($echo = true) {
|
|||
|
||||
$search_form_template = locate_template('searchform.php');
|
||||
if ( '' != $search_form_template ) {
|
||||
ob_start();
|
||||
require($search_form_template);
|
||||
return;
|
||||
$form = ob_get_clean();
|
||||
} else {
|
||||
$form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '" >
|
||||
<div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
|
||||
<input type="text" value="' . get_search_query() . '" name="s" id="s" />
|
||||
<input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
|
||||
</div>
|
||||
</form>';
|
||||
}
|
||||
|
||||
$form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '" >
|
||||
<div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
|
||||
<input type="text" value="' . get_search_query() . '" name="s" id="s" />
|
||||
<input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
|
||||
</div>
|
||||
</form>';
|
||||
|
||||
if ( $echo )
|
||||
echo apply_filters('get_search_form', $form);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue