Make WordPress Core

Ticket #32528: hook_search_form_content.diff

File hook_search_form_content.diff, 1.5 KB (added by charlestonsw, 10 years ago)

Proposed patch as desribed in ticket.

  • src/wp-includes/general-template.php

     
    227227                                <label>
    228228                                        <span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span>
    229229                                        <input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" title="' . esc_attr_x( 'Search for:', 'label' ) . '" />
    230                                 </label>
    231                                 <input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
     230                                </label>'.
     231                apply_filters( 'search_form_content', '' ) .
     232                                '<input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
    232233                        </form>';
    233234                } else {
    234235                        $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
    235236                                <div>
    236237                                        <label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label>
    237                                         <input type="text" value="' . get_search_query() . '" name="s" id="s" />
    238                                         <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
     238                                        <input type="text" value="' . get_search_query() . '" name="s" id="s" />' .
     239                     apply_filters( 'search_form_content', '' ) .
     240                                        '<input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
    239241                                </div>
    240242                        </form>';
    241243                }