WordPress.org

Make WordPress Core

Changeset 9234


Ignore:
Timestamp:
10/17/2008 08:39:56 PM (10 years ago)
Author:
ryan
Message:

get_search_form from technosailor. fixes #7910

Location:
trunk
Files:
1 deleted
7 edited

Legend:

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

    r9226 r9234  
    6464        else
    6565            echo("<h2 class='center'>No posts found.</h2>");
    66         include (TEMPLATEPATH . '/searchform.php');
     66        get_search_form();
    6767
    6868    endif;
  • trunk/wp-content/themes/default/archives.php

    r8999 r9234  
    1313<div id="content" class="widecolumn">
    1414
    15 <?php include (TEMPLATEPATH . '/searchform.php'); ?>
     15<?php get_search_form(); ?>
    1616
    1717<h2>Archives by Month:</h2>
  • trunk/wp-content/themes/default/index.php

    r8999 r9234  
    3535        <h2 class="center">Not Found</h2>
    3636        <p class="center">Sorry, but you are looking for something that isn't here.</p>
    37         <?php include (TEMPLATEPATH . "/searchform.php"); ?>
     37        <?php get_search_form(); ?>
    3838
    3939    <?php endif; ?>
  • trunk/wp-content/themes/default/search.php

    r8999 r9234  
    3838
    3939        <h2 class="center">No posts found. Try a different search?</h2>
    40         <?php include (TEMPLATEPATH . '/searchform.php'); ?>
     40        <?php get_search_form(); ?>
    4141
    4242    <?php endif; ?>
  • trunk/wp-content/themes/default/sidebar.php

    r8999 r9234  
    1010                    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    1111            <li>
    12                 <?php include (TEMPLATEPATH . '/searchform.php'); ?>
     12                <?php get_search_form(); ?>
    1313            </li>
    1414
  • trunk/wp-includes/general-template.php

    r9097 r9234  
    9292    if ('' == locate_template($templates, true))
    9393        load_template( get_theme_root() . '/default/sidebar.php');
     94}
     95
     96function get_search_form() {
     97    do_action( 'get_search_form' );
     98
     99    if ( '' != locate_template(array('searchform.php'), true) )
     100        return;
     101
     102    $form = '<form method="get" id="searchform" action="' . get_option('siteurl') . '/" >
     103    <label class="hidden" for="s">' . __('Search for:') . '</label>
     104    <div><input type="text" value="' . the_search_query() . '" name="s" id="s" />
     105    <input type="submit" id="searchsubmit" value="Search" />
     106    </div>
     107    </form>';
     108
     109    echo apply_filters('get_search_form', $form);
    94110}
    95111
  • trunk/wp-includes/widgets.php

    r9219 r9234  
    764764function wp_widget_search($args) {
    765765    extract($args);
    766     $searchform_template = get_template_directory() . '/searchform.php';
    767 
    768766    echo $before_widget;
    769767
    770768    // Use current theme search form if it exists
    771     if ( file_exists($searchform_template) ) {
    772         include_once($searchform_template);
    773     } else { ?>
    774         <form id="searchform" method="get" action="<?php bloginfo('url'); ?>/"><div>
    775             <label class="hidden" for="s"><?php _e('Search for:'); ?></label>
    776             <input type="text" name="s" id="s" size="15" value="<?php the_search_query(); ?>" />
    777             <input type="submit" value="<?php echo attribute_escape(__('Search')); ?>" />
    778         </div></form>
    779     <?php }
    780 
     769    get_search_form();
     770   
    781771    echo $after_widget;
    782772}
Note: See TracChangeset for help on using the changeset viewer.