the_search_query() from mdawaffe. fixes #914

git-svn-id: https://develop.svn.wordpress.org/trunk@4171 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-09-07 17:37:26 +00:00
parent 3a5e26cad4
commit 9e8323d14d
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>

View File

@ -30,7 +30,7 @@
<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
<p>You have searched the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for <strong>'<?php echo wp_specialchars($s); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p>You are currently browsing the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives.</p>

View File

@ -801,4 +801,9 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
<?php
}
function the_search_query() {
global $s;
echo wp_specialchars( stripslashes($s), 1 );
}
?>