Last active
August 29, 2015 13:57
-
-
Save Xtremefaith/9615334 to your computer and use it in GitHub Desktop.
Want to redirect a user who enters a blank search request, here is a snippet to help with that.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'request', 'my_request_filter' ); | |
function my_request_filter( $query_vars ) { | |
if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) { | |
$query_vars['s'] = " "; | |
} | |
return $query_vars; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment