Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
// integration of SearchWP and Advance WP Query Search Filter
function my_searchwp_maybe_short_circuit() {
// advance wp query search filter saves a nonce as the search query
// if that validates, we want to short circuit SearchWP
if( isset( $_GET['s'] ) ) {
if( wp_verify_nonce( esc_attr( $_GET['s'] ), 'awqsfsearch' ) ) {
return true;
}
}
return false;
}
add_filter( 'searchwp_short_circuit', 'my_searchwp_maybe_short_circuit' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.