Skip to content

Commit fe6cbaf

Browse files
committed
Search: remove unused vars, update phpdocs
1 parent 71b48e6 commit fe6cbaf

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

‎modules/search/class.jetpack-search.php‎

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ public function filter__posts_pre_query( $posts, $query ) {
216216
* @param WP_Query $query The original WP_Query to use for the parameters of our search
217217
*/
218218
public function do_search( WP_Query $query ) {
219-
global $wpdb;
220-
221219
if ( ! $query->is_main_query() || ! $query->is_search() ) {
222220
return;
223221
}
@@ -444,8 +442,8 @@ public function get_search_result( $raw = false ) {
444442
/**
445443
* Add the date portion of a WP_Query onto the query args
446444
*
447-
* @param array $es_wp_query_args
448-
* @param $query The original WP_Query
445+
* @param array $es_wp_query_args
446+
* @param WP_Query $query The original WP_Query
449447
*
450448
* @return array The es wp query args, with date filters added (as needed)
451449
*/
@@ -528,8 +526,6 @@ function convert_wp_es_to_es_args( array $args ) {
528526
'aggregations' => null,
529527
);
530528

531-
$raw_args = $args; // Keep a copy
532-
533529
$args = wp_parse_args( $args, $defaults );
534530

535531
$es_query_args = array(
@@ -778,7 +774,7 @@ public function add_aggregations_to_es_query_builder( array $aggregations, Jetpa
778774
* @module search
779775
*
780776
* @param array $aggregation The aggregation to add to the query builder
781-
* @param $label The 'label' (unique id) for this aggregation
777+
* @param string $label The 'label' (unique id) for this aggregation
782778
* @param Jetpack_WPES_Query_Builder $builder The builder instance that is creating the ES query
783779
*/
784780
public function add_taxonomy_aggregation_to_es_query_builder( array $aggregation, $label, Jetpack_WPES_Query_Builder $builder ) {
@@ -812,7 +808,7 @@ public function add_taxonomy_aggregation_to_es_query_builder( array $aggregation
812808
* @module search
813809
*
814810
* @param array $aggregation The aggregation to add to the query builder
815-
* @param $label The 'label' (unique id) for this aggregation
811+
* @param string $label The 'label' (unique id) for this aggregation
816812
* @param Jetpack_WPES_Query_Builder $builder The builder instance that is creating the ES query
817813
*/
818814
public function add_post_type_aggregation_to_es_query_builder( array $aggregation, $label, Jetpack_WPES_Query_Builder $builder ) {
@@ -830,7 +826,7 @@ public function add_post_type_aggregation_to_es_query_builder( array $aggregatio
830826
* @module search
831827
*
832828
* @param array $aggregation The aggregation to add to the query builder
833-
* @param $label The 'label' (unique id) for this aggregation
829+
* @param string $label The 'label' (unique id) for this aggregation
834830
* @param Jetpack_WPES_Query_Builder $builder The builder instance that is creating the ES query
835831
*/
836832
public function add_date_histogram_aggregation_to_es_query_builder( array $aggregation, $label, Jetpack_WPES_Query_Builder $builder ) {
@@ -982,7 +978,7 @@ public function get_search_facets() {
982978
*
983979
* @module search
984980
*
985-
* @param WP_Query The optional original WP_Query to use for determining which filters are active. Defaults to the main query
981+
* @param WP_Query $query The optional original WP_Query to use for determining which filters are active. Defaults to the main query
986982
*
987983
* @return array Array of Filters applied and info about them
988984
*/
@@ -1246,11 +1242,9 @@ public function get_search_facet_data() {
12461242
*
12471243
* @module search
12481244
*
1249-
* @param WP_Query $query An optional WP_Query object - defaults to global $wp_query
1250-
*
12511245
* @return array Array if Filters that were applied
12521246
*/
1253-
public function get_active_filter_buckets( WP_Query $query = null ) {
1247+
public function get_active_filter_buckets() {
12541248
$active_buckets = array();
12551249

12561250
$filters = $this->get_filters();
@@ -1279,11 +1273,9 @@ public function get_active_filter_buckets( WP_Query $query = null ) {
12791273
*
12801274
* @module search
12811275
*
1282-
* @param WP_Query $query An optional WP_Query object - defaults to global $wp_query
1283-
*
12841276
* @return array Array if Filters that were applied
12851277
*/
1286-
public function get_current_filters( WP_Query $query = null ) {
1278+
public function get_current_filters() {
12871279
_deprecated_function( __METHOD__, 'jetpack-5.0', 'Jetpack_Search::get_active_filter_buckets()' );
12881280

12891281
return $this->get_active_filter_buckets();

0 commit comments

Comments
 (0)