-
-
Save jchristopher/17f6b41381722e256abedab761ef43a9 to your computer and use it in GitHub Desktop.
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
<?php | |
function my_searchwp_engine_customizations( $settings, $query ) { | |
// print_r( $settings ); // uncomment this line to see the settings structure | |
// print_r( $query ); // uncomment this line to see the query structure | |
// Check for Title-only search | |
if ( empty( $_REQUEST['searchwp_limit_to_title'] ) ) { | |
return $settings; | |
} | |
// Return the Titles Only engine settings | |
return SWP()->settings['engines']['titles_only']; // titles_only is the Supplemental Engine NAME (not label) | |
} | |
add_filter( 'searchwp_engine_settings_default', 'my_searchwp_engine_customizations', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment