Skip to content

Commit

Permalink
Merge pull request #432 from pantheon-systems/filter-ajax-query-args
Browse files Browse the repository at this point in the history
Add `solr_power_ajax_search_query_args` filter to modify AJAX search
  • Loading branch information
danielbachhuber authored Nov 16, 2019
2 parents ab789c4 + b98abc3 commit 1735234
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Requires at least:** 4.6
**Requires PHP:** 7.1
**Tested up to:** 5.3
**Stable tag:** 2.1.2
**Stable tag:** 2.1.3
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -166,6 +166,9 @@ To support searching by author name (e.g. where "Pantheon" would return posts au

## Changelog ##

### 2.1.3 (November 16, 2019) ###
* Add `solr_power_ajax_search_query_args` filter to modify AJAX search query arguments [[#432](https://github.com/pantheon-systems/solr-power/pull/432)].

### 2.1.2 (August 28, 2019) ###
* Adds `solr_is_private_blog` filter to allow control over whether a blog is indexed [[#423](https://github.com/pantheon-systems/solr-power/pull/423)].

Expand Down
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
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: search
Requires at least: 4.6
Requires PHP: 7.1
Tested up to: 5.3
Stable tag: 2.1.2
Stable tag: 2.1.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -166,6 +166,9 @@ To support searching by author name (e.g. where "Pantheon" would return posts au

== Changelog ==

= 2.1.3 (November 16, 2019) =
* Add `solr_power_ajax_search_query_args` filter to modify AJAX search query arguments [[#432](https://github.com/pantheon-systems/solr-power/pull/432)].

= 2.1.2 (August 28, 2019) =
* Adds `solr_is_private_blog` filter to allow control over whether a blog is indexed [[#423](https://github.com/pantheon-systems/solr-power/pull/423)].

Expand Down
4 changes: 2 additions & 2 deletions solr-power.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/**
* Plugin Name: Solr Power
* Description: Allows WordPress sites to index and search content with ApacheSolr.
* Version: 2.1.2
* Version: 2.1.3
* Author: Pantheon
* Author URI: http://pantheon.io
* Text Domain: solr-for-wordpress-on-pantheon
*
* @package Solr_Power
**/

define( 'SOLR_POWER_VERSION', '2.1.2' );
define( 'SOLR_POWER_VERSION', '2.1.3' );

/**
* Copyright (c) 2011-2019 Pantheon, Matt Weber, Solr Power contributors
Expand Down

0 comments on commit 1735234

Please sign in to comment.