WordPress.org

Make WordPress Core

Ticket #4792: search-query.diff

File search-query.diff, 693 bytes (added by joostdevalk, 8 years ago)

Patch

  • wp-includes/general-template.php

     
    966966        return apply_filters( 'get_search_query', stripslashes( get_query_var( 's' ) ) ); 
    967967} 
    968968 
    969 function the_search_query() { 
    970         echo attribute_escape( apply_filters( 'the_search_query', get_search_query() ) ); 
     969function the_search_query( $display = true ) { 
     970        $search_query = attribute_escape( apply_filters( 'the_search_query', get_search_query() ) ); 
     971        if ( $display ) 
     972                echo $search_query; 
     973        else 
     974                return $search_query; 
    971975} 
    972976 
    973977function language_attributes() {