From b82ce63fbaa577c66718e6f53614029c28bee7d5 Mon Sep 17 00:00:00 2001
From: Yasir Arafat <148990700+Arafat-plugins@users.noreply.github.com>
Date: Tue, 27 Jan 2026 11:53:04 +0600
Subject: [PATCH 3/4] hooks name fixed
---
includes/model/Listings.php | 2 +-
templates/archive/grid-view.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/includes/model/Listings.php b/includes/model/Listings.php
index b07b512e0b..928f306f2a 100644
--- a/includes/model/Listings.php
+++ b/includes/model/Listings.php
@@ -1299,7 +1299,7 @@ public function render_grid_view( $post_ids ) {
foreach ( $post_ids as $listing_id ) {
$is_slider = apply_filters(
- 'addonskit_directorist_is_slider',
+ 'directorist_listings_is_slider',
false,
$this
);
diff --git a/templates/archive/grid-view.php b/templates/archive/grid-view.php
index 73cbeec475..8ba59b60ba 100644
--- a/templates/archive/grid-view.php
+++ b/templates/archive/grid-view.php
@@ -23,7 +23,7 @@
$default_class = ( $listings->has_masonry() ? 'directorist-masonry' : '' ) . ' ' . $row_class;
?>
From 3315c5beb0b5db252c628d5b9b970c527523e334 Mon Sep 17 00:00:00 2001
From: Yasir Arafat <148990700+Arafat-plugins@users.noreply.github.com>
Date: Wed, 28 Jan 2026 08:52:43 +0600
Subject: [PATCH 4/4] hook name changed and codes cleaning and speed checked
---
includes/model/Listings.php | 43 +++++++++++++++++++++++++--------
templates/archive/grid-view.php | 6 ++++-
templates/archive/list-view.php | 32 +++++++++++-------------
templates/archive/loop-grid.php | 1 -
4 files changed, 52 insertions(+), 30 deletions(-)
diff --git a/includes/model/Listings.php b/includes/model/Listings.php
index 928f306f2a..f4d2a26178 100644
--- a/includes/model/Listings.php
+++ b/includes/model/Listings.php
@@ -1282,11 +1282,20 @@ public function render_list_view( $post_ids ) {
}
foreach ( $post_ids as $listing_id ) {
- ?>
-
- loop_template( 'list', $listing_id ); ?>
-
-
+
+ loop_template( 'list', $listing_id ); ?>
+
+ loop_template( 'list', $listing_id );
+ endif;
}
}
@@ -1299,17 +1308,31 @@ public function render_grid_view( $post_ids ) {
foreach ( $post_ids as $listing_id ) {
$is_slider = apply_filters(
- 'directorist_listings_is_slider',
+ 'directorist_listings_grid_items_view_before',
false,
$this
- );
- if ( ! $is_slider ) : ?>
-
+ );
+
+ $default_wrapper_class = '';
+ ob_start();
+ Helper::directorist_column( $this->columns );
+ $default_wrapper_class = trim( ob_get_clean() );
+
+ $grid_item_wrapper_class = apply_filters(
+ 'directorist_listings_grid_item_wrapper_class',
+ $default_wrapper_class,
+ $this
+ );
+
+ $has_grid_item_wrapper = ( ! $is_slider && '' !== trim( (string) $grid_item_wrapper_class ) );
+
+ if ( $has_grid_item_wrapper ) : ?>
+
loop_template( 'grid', $listing_id ); ?>
-
+
has_masonry() ? 'directorist-masonry' : '' ) . ' ' . $row_class;
?>
-
">
+
render_grid_view( $listings->post_ids() ) ?>
+
+
show_pagination && 'numbered' === $listings->options['pagination_type'] ) {
diff --git a/templates/archive/list-view.php b/templates/archive/list-view.php
index 8e75fb166e..564173f725 100644
--- a/templates/archive/list-view.php
+++ b/templates/archive/list-view.php
@@ -16,24 +16,20 @@
have_posts() ) : ?>
-
-
- render_list_view( $listings->post_ids() ) ?>
-
-
-
- show_pagination && 'numbered' === $listings->options['pagination_type'] ) {
-
- do_action( 'directorist_before_listings_pagination' );
-
- $listings->pagination();
-
- do_action( 'directorist_after_listings_pagination' );
- }
- ?>
-
-
+
+
+ render_list_view( $listings->post_ids() ) ?>
+
diff --git a/templates/archive/loop-grid.php b/templates/archive/loop-grid.php
index 18810cd02a..7991f12f7f 100644
--- a/templates/archive/loop-grid.php
+++ b/templates/archive/loop-grid.php
@@ -6,7 +6,6 @@
*/
if ( ! defined( 'ABSPATH' ) ) exit;
-
$loop_fields = $listings->loop['card_fields']['template_data']['grid_view_with_thumbnail'];
?>