From 22c65f696a94059718d1288bbf599df5e714898d Mon Sep 17 00:00:00 2001 From: Hoang Huu Date: Tue, 16 Jun 2020 17:34:51 +0700 Subject: [PATCH] Fixes --- inc/property/class-opalestate-search.php | 38 +++++++++++++++++------- opal-estate-pro.php | 2 +- templates/messages/enquiry-form.php | 8 ++--- templates/parts/archive-search-block.php | 19 ++++++------ 4 files changed, 42 insertions(+), 25 deletions(-) diff --git a/inc/property/class-opalestate-search.php b/inc/property/class-opalestate-search.php index 3786aff1..5dfd55f7 100755 --- a/inc/property/class-opalestate-search.php +++ b/inc/property/class-opalestate-search.php @@ -77,11 +77,19 @@ class OpalEstate_Search { $tax_query = []; if ( isset( $_GET['location'] ) && $_GET['location'] != -1 ) { - $tax_query[] = [ - 'taxonomy' => 'opalestate_location', - 'field' => 'slug', - 'terms' => sanitize_text_field( $_GET['location'] ), - ]; + if ( is_array( $_GET['location'] ) ) { + $tax_query[] = [ + 'taxonomy' => 'opalestate_location', + 'field' => 'slug', + 'terms' => opalestate_clean( $_GET['location'] ), + ]; + } else { + $tax_query[] = [ + 'taxonomy' => 'opalestate_location', + 'field' => 'slug', + 'terms' => sanitize_text_field( $_GET['location'] ), + ]; + } } if ( isset( $_GET['state'] ) && $_GET['state'] != -1 ) { @@ -101,11 +109,19 @@ class OpalEstate_Search { } if ( isset( $_GET['city'] ) && $_GET['city'] != -1 ) { - $tax_query[] = [ - 'taxonomy' => 'opalestate_city', - 'field' => 'slug', - 'terms' => sanitize_text_field( $_GET['city'] ), - ]; + if ( is_array( $_GET['city'] ) ) { + $tax_query[] = [ + 'taxonomy' => 'opalestate_city', + 'field' => 'slug', + 'terms' => opalestate_clean( $_GET['city'] ), + ]; + } else { + $tax_query[] = [ + 'taxonomy' => 'opalestate_city', + 'field' => 'slug', + 'terms' => sanitize_text_field( $_GET['city'] ), + ]; + } } if ( isset( $_GET['types'] ) && $_GET['types'] != -1 ) { @@ -165,6 +181,8 @@ class OpalEstate_Search { ]; } + $tax_query = apply_filters( 'opalestate_search_results_tax_query', $tax_query ); + if ( $tax_query ) { $args['tax_query'] = [ 'relation' => 'AND' ]; $args['tax_query'] = array_merge( $args['tax_query'], $tax_query ); diff --git a/opal-estate-pro.php b/opal-estate-pro.php index c1143d31..52873c73 100755 --- a/opal-estate-pro.php +++ b/opal-estate-pro.php @@ -3,7 +3,7 @@ * Plugin Name: Opal Estate Pro * Plugin URI: https://wpdocs.gitbook.io/opal-estate/ * Description: Opal Real Estate Plugin is an ideal solution and brilliant choice for you to set up a professional estate website. - * Version: 1.5.6 + * Version: 1.5.7 * Author: WPOPAL * Author URI: http://www.wpopal.com * Requires at least: 4.9 diff --git a/templates/messages/enquiry-form.php b/templates/messages/enquiry-form.php index bb68cdf4..c22b5aef 100755 --- a/templates/messages/enquiry-form.php +++ b/templates/messages/enquiry-form.php @@ -1,13 +1,13 @@ get_equiry_form_fields( $message ); diff --git a/templates/parts/archive-search-block.php b/templates/parts/archive-search-block.php index d1867d43..a7fd7099 100755 --- a/templates/parts/archive-search-block.php +++ b/templates/parts/archive-search-block.php @@ -1,12 +1,11 @@ -
-
-
- -
- -
-
\ No newline at end of file +
+
+ +
+
+