Manually populate the get_search_query() value

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

add_filter( ‘get_search_query’, function( $keywords ) {
if ( empty( $keywords ) ) {
$get_var = $_GET[‘s’];
if ( ! empty( $get_var ) ) {
$keywords = $get_var;
}
}
return $keywords;
});
{{/gist}}