Make WordPress Core

Changeset 4171


Ignore:
Timestamp:
09/07/2006 05:37:26 PM (19 years ago)
Author:
ryan
Message:

the_search_query() from mdawaffe. fixes #914

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/default/searchform.php

    r3134 r4171  
    11<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
    2 <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
     2<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
    33<input type="submit" id="searchsubmit" value="Search" />
    44</div>
  • trunk/wp-content/themes/default/sidebar.php

    r4016 r4171  
    3131         <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
    3232            <p>You have searched the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
    33             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>
     33            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>
    3434
    3535            <?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
  • trunk/wp-includes/general-template.php

    r4168 r4171  
    802802}
    803803
     804function the_search_query() {
     805    global $s;
     806    echo wp_specialchars( stripslashes($s), 1 );
     807}
     808
    804809?>
Note: See TracChangeset for help on using the changeset viewer.