Skip to content

Commit

Permalink
Add solr_power_ajax_search_query_args filter to modify AJAX search
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Nov 16, 2019
1 parent ab789c4 commit 91c6fd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/class-solrpower.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,13 @@ function ( $url ) {
$paged = filter_input( INPUT_GET, 'paged', FILTER_SANITIZE_STRING );
$paged = ( false === $paged || null === $paged ) ? 1 : absint( $paged );

$args = array(
$args = array(
's' => filter_input( INPUT_GET, 's', FILTER_SANITIZE_STRING ),
'facets' => filter_input( INPUT_GET, 'facet', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY ),
'posts_per_page' => get_option( 'posts_per_page' ),
'paged' => $paged,
);

$args = apply_filters( 'solr_power_ajax_search_query_args', $args );
$query = new WP_Query( $args );
$query->get_posts();

Expand Down

0 comments on commit 91c6fd3

Please sign in to comment.