Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Last active June 21, 2020 23:23
Show Gist options
  • Save jchristopher/046e62499a9f32cc8b7b to your computer and use it in GitHub Desktop.
Save jchristopher/046e62499a9f32cc8b7b to your computer and use it in GitHub Desktop.
Have SearchWP short circuit if an empty search was submitted
<?php
if ( isset( $_GET['s'] ) && 0 == strlen( trim( $_GET['s'] ) ) ) {
add_filter( 'searchwp_short_circuit', '__return_true' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment