Use searchform.php for search widget, if available. Props ionfish. fixes #5567
git-svn-id: http://svn.automattic.com/wordpress/trunk@8250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9a7c30f64c
commit
3ceeaa6252
|
@ -461,17 +461,22 @@ function wp_widget_links($args) {
|
|||
|
||||
function wp_widget_search($args) {
|
||||
extract($args);
|
||||
?>
|
||||
<?php echo $before_widget; ?>
|
||||
<form id="searchform" method="get" action="<?php bloginfo('home'); ?>">
|
||||
<div>
|
||||
$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 { ?>
|
||||
<form id="searchform" method="get" action="<?php bloginfo('url'); ?>/"><div>
|
||||
<label class="hidden" for="s"><?php _e('Search for:'); ?></label>
|
||||
<input type="text" name="s" id="s" size="15" /><br />
|
||||
<input type="text" name="s" id="s" size="15" value="<?php the_search_query(); ?>" />
|
||||
<input type="submit" value="<?php echo attribute_escape(__('Search')); ?>" />
|
||||
</div>
|
||||
</form>
|
||||
<?php echo $after_widget; ?>
|
||||
<?php
|
||||
</div></form>
|
||||
<?php }
|
||||
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
function wp_widget_archives($args) {
|
||||
|
|
Loading…
Reference in New Issue