WordPress.org

Make WordPress Core

Changeset 23666


Ignore:
Timestamp:
03/12/2013 09:51:56 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Always respect $echo argument in get_search_form(). props garyc40, kawauso. fixes #16541.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r23482 r23666  
    155155    $search_form_template = locate_template('searchform.php');
    156156    if ( '' != $search_form_template ) {
     157        ob_start();
    157158        require($search_form_template);
    158         return;
    159     }
    160 
    161     $form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '" >
    162     <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
    163     <input type="text" value="' . get_search_query() . '" name="s" id="s" />
    164     <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
    165     </div>
    166     </form>';
     159        $form = ob_get_clean();
     160    } else {
     161        $form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '" >
     162        <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
     163        <input type="text" value="' . get_search_query() . '" name="s" id="s" />
     164        <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
     165        </div>
     166        </form>';
     167    }
    167168
    168169    if ( $echo )
Note: See TracChangeset for help on using the changeset viewer.