Make WordPress Core

Ticket #16539: 16539-8.patch

File 16539-8.patch, 1.5 KB (added by WraithKenny, 12 years ago)
  • wp-includes/general-template.php

     
    157157
    158158        do_action( 'pre_get_search_form' );
    159159
    160         $format = apply_filters( 'search_form_format', 'xhtml' );
     160        $format = apply_filters( 'search_form_format', '' );
    161161
    162162        // Initialize the values
    163163        $form_id   = $search_form_counter ? '' : ' id="searchform"';
     
    179179                                        <input type="submit" class="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
    180180                                </div>
    181181                        </form>';
    182                 } else {
     182                } else if ( 'xhtml' == $format ) {
    183183                        $form = '<form role="search" method="get"' . $form_id . ' class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
    184184                                <div>
    185185                                        <label class="screen-reader-text" for="' . $text_id . '">' . _x( 'Search for:', 'label' ) . '</label>
     
    187187                                        <input type="submit"' . $submit_id . ' value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
    188188                                </div>
    189189                        </form>';
     190                } else {
     191                        $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
     192                                <div>
     193                                        <label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label>
     194                                        <input type="text" value="' . get_search_query() . '" name="s" id="s" />
     195                                        <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
     196                                </div>
     197                        </form>';
    190198                }
    191199        }
    192200