Make WordPress Core

Ticket #14851: 14851.3.patch

File 14851.3.patch, 1.0 KB (added by terminalpixel, 11 years ago)
  • src/wp-includes/general-template.php

     
    198198 *
    199199 * @since 2.7.0
    200200 *
    201  * @param boolean $echo Default to echo and not return the form.
     201 * @param boolean|string $echo Default to echo and not return the form or if string returns the specialised searchform
    202202 * @return string|null String when retrieving, null when displaying or if searchform.php exists.
    203203 */
    204204function get_search_form( $echo = true ) {
     
    224224         */
    225225        $format = apply_filters( 'search_form_format', $format );
    226226
    227         $search_form_template = locate_template( 'searchform.php' );
     227        $templates = array();
     228        $name = $echo;
     229        if ( is_string( $name ) ) {
     230                $templates[] = "searchform-{$name}.php";
     231        }
     232        $templates[] = 'searchform.php';
     233        $search_form_template = locate_template( $templates );
    228234        if ( '' != $search_form_template ) {
    229235                ob_start();
    230236                require( $search_form_template );