From 376d25d9b7da56910361d1f90806cdaa3125e346 Mon Sep 17 00:00:00 2001 From: Kowsar Hossain Date: Mon, 14 Nov 2022 07:56:46 +0600 Subject: [PATCH] Fixed search result issse (#1264) --- includes/model/Listings.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/model/Listings.php b/includes/model/Listings.php index 5e9fc1c45c..1f4ed459ac 100644 --- a/includes/model/Listings.php +++ b/includes/model/Listings.php @@ -119,7 +119,9 @@ public function __construct( $atts = array(), $type = 'listing', $query_args = f $this->set_options(); - if ( 'search_result' == $this->type ) { + $current_page = !empty( $this->atts['_current_page'] ) ? $this->atts['_current_page'] : ''; + + if ( 'search_result' === $this->type || ( 'instant_search' == $this->type && 'search_result' === $current_page ) ) { $this->update_search_options(); } @@ -1714,6 +1716,7 @@ public function get_wrapper_class( $class = '' ) { } public function data_atts() { + $this->atts['_current_page'] = $this->type; // search_result or listing // Separates class names with a single space, collates class names for wrapper tag element. echo 'data-atts="' . esc_attr( json_encode( $this->atts ) ) . '"'; }