From f4a77a66b42922f9168d34fef00bab7e13821924 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 12 Mar 2013 09:51:56 +0000 Subject: [PATCH] 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 --- wp-includes/general-template.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index cb2e21ca41..999aa0f2aa 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -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 = ''; - if ( $echo ) echo apply_filters('get_search_form', $form); else