From 5ffc4fbcef48b9a3b375997eee8b310850e5a3e1 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 3 Jul 2008 17:03:37 +0000 Subject: [PATCH] Use searchform.php for search widget, if available. Props ionfish. fixes #5567 git-svn-id: https://develop.svn.wordpress.org/trunk@8250 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/widgets.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index fd0bc3d2a2..1dd8bd35a5 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -461,17 +461,22 @@ function wp_widget_links($args) { function wp_widget_search($args) { extract($args); -?> - -
-
+ $searchform_template = get_template_directory() . '/searchform.php'; + + echo $before_widget; + + // Use current theme search form if it exists + if ( file_exists($searchform_template) ) { + include_once($searchform_template); + } else { ?> +
-
+ -
- - - +