Created
November 9, 2020 18:22
-
-
Save stephensabatini/74921ddd46d532021b14f37ceaa2ae3d to your computer and use it in GitHub Desktop.
Solr Power Plugin Support
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 | |
/** | |
* Integrate Solr Power plugin support. | |
* | |
* @author Stephen Sabatini <info@stephensabatini.com> | |
* @license MIT | |
*/ | |
add_filter( 'pre_get_posts', 'solr_search' ); | |
function solr_search( $query ) { | |
if ( is_plugin_active( 'solr-power/solr-power.php' ) && ! is_admin() && $query->is_main_query() && $query->is_search() ) { | |
$query->set( 'solr-integrate', true ); | |
} | |
return $query; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment