Skip to content

Commit

Permalink
Add is_solr_query filter (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
sboisvert authored Dec 4, 2024
1 parent 6015e92 commit f9add2f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion includes/class-solrpower-wp-query.php
Original file line number Diff line number Diff line change
@@ -1251,7 +1251,16 @@ function compare_date( $field, $field_value, $compare = '=' ) {
* @return boolean
*/
private function is_solr_query( $query ) {
return $query->is_search() || $query->get( 'solr_integrate' );
$enabled = $query->is_search() || $query->get( 'solr_integrate' );
/**
* Filter is_solr_query
*
* Enables the ability to turn off Solr for queries.
*
* @param boolean $enabled Should Solr run for this query?
* @param WP_Query $query The WP_Query.
*/
return apply_filters( 'is_solr_query', $enabled, $query );
}

}

0 comments on commit f9add2f

Please sign in to comment.