Make WordPress Core

Changeset 2302


Ignore:
Timestamp:
02/13/2005 08:32:24 PM (22 years ago)
Author:
rboren
Message:

Don't redirect to permalink page if search returns one result. Move search template load higher up in load order.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-blog-header.php

    r2301 r2302  
    167167
    168168if (1 == count($posts)) {
    169         if (is_single()) {
    170                 $more = 1;
    171                 $single = 1;
    172         }
    173         if ( $s && empty($paged) && !strstr($_SERVER['PHP_SELF'], 'wp-admin/')) { // If they were doing a search and got one result
    174                 header('Location: ' . get_permalink($posts[0]->ID));
    175         }
     169        $more = 1;
     170        $single = 1;
    176171}
    177172
    … …  
    219214                        include(get_404_template());
    220215                        exit;
     216                } else if ( is_search() && get_search_template() ) {
     217                        include(get_search_template());
     218                        exit;
    221219                } else if ( is_home() && get_home_template() ) {
    222220                        include(get_home_template());
    … …  
    240238                        include(get_archive_template());
    241239                        exit;
    242                 } else if ( is_search() && get_search_template() ) {
    243                         include(get_search_template());
    244                         exit;
    245240                } else if ( is_paged() && get_paged_template() ) {
    246241                        include(get_paged_template());
Note: See TracChangeset for help on using the changeset viewer.