The Post Grid - Version 2.3.6

Version Description

  • Update filter button and item view class
Download this release

Release Info

Developer techlabpro1
Plugin Icon 128x128 The Post Grid
Version 2.3.6
Comparing to
See all releases

Code changes from version 2.3.5 to 2.3.6

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: post grid, content grid, post display, post format, post view, blog display, news display, post
5
  Requires at least: 4.5
6
  Tested up to: 5.5
7
- Stable tag: 2.3.5
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -140,6 +140,9 @@ For any bug or suggestion please mail support@radiustheme.com
140
 
141
  == Changelog ==
142
 
 
 
 
143
  = 2.3.5 =
144
  * Add WordPress 5.5 Compatibility
145
 
4
  Tags: post grid, content grid, post display, post format, post view, blog display, news display, post
5
  Requires at least: 4.5
6
  Tested up to: 5.5
7
+ Stable tag: 2.3.6
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
140
 
141
  == Changelog ==
142
 
143
+ = 2.3.6 =
144
+ * Update filter button and item view class
145
+
146
  = 2.3.5 =
147
  * Add WordPress 5.5 Compatibility
148
 
languages/the-post-grid.pot CHANGED
@@ -285,15 +285,15 @@ msgstr ""
285
  msgid "Get Pro Version"
286
  msgstr ""
287
 
288
- #: ../lib/classes/rtTPGShortCode.php:382
289
  msgid "No shortCode found"
290
  msgstr ""
291
 
292
- #: ../lib/classes/rtTPGShortCode.php:380
293
  msgid "Session Error !!"
294
  msgstr ""
295
 
296
- #: ../lib/classes/rtTPGShortCode.php:352
297
  msgid "No post found"
298
  msgstr ""
299
 
285
  msgid "Get Pro Version"
286
  msgstr ""
287
 
288
+ #: ../lib/classes/rtTPGShortCode.php:388
289
  msgid "No shortCode found"
290
  msgstr ""
291
 
292
+ #: ../lib/classes/rtTPGShortCode.php:386
293
  msgid "Session Error !!"
294
  msgstr ""
295
 
296
+ #: ../lib/classes/rtTPGShortCode.php:358
297
  msgid "No post found"
298
  msgstr ""
299
 
lib/classes/rtTPGShortCode.php CHANGED
@@ -80,7 +80,7 @@ if (!class_exists('rtTPGShortCode')):
80
  $order = isset($scMeta['order']) ? $scMeta['order'] : null;
81
  $s = isset($scMeta['s']) ? $scMeta['s'] : null;
82
  $isotope_filter = isset($scMeta['isotope_filter']) ? $scMeta['isotope_filter'] : null;
83
- $link = empty($scMeta['link_to_detail_page']) || (!empty($scMeta['link_to_detail_page']) && $scMeta['link_to_detail_page'] === "yes") ? true :false;
84
  $link_target = !empty($scMeta['link_target']) ? $scMeta['link_target'] : null;
85
  } else {
86
  $scMeta = get_post_meta($scID);
@@ -111,7 +111,7 @@ if (!class_exists('rtTPGShortCode')):
111
  $order = isset($scMeta['order'][0]) ? $scMeta['order'][0] : null;
112
  $s = isset($scMeta['s'][0]) ? $scMeta['s'][0] : null;
113
  $isotope_filter = isset($scMeta['isotope_filter'][0]) ? $scMeta['isotope_filter'][0] : null;
114
- $link = empty($scMeta['link_to_detail_page'][0]) || (!empty($scMeta['link_to_detail_page'][0]) && $scMeta['link_to_detail_page'][0] === "yes") ? true :false;
115
  $link_target = !empty($scMeta['link_target'][0]) ? $scMeta['link_target'][0] : null;
116
 
117
  }
@@ -253,11 +253,12 @@ if (!class_exists('rtTPGShortCode')):
253
  $arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-6 rt-col-xs-12";
254
  }
255
 
256
-
257
- $arg['class'] = 'rt-equal-height';
258
  if ($isIsotope) {
259
- $arg['class'] .= ' isotope-item';
260
  }
 
261
  $arg['link'] = $link;
262
  $arg['link_target'] = $link_target ? " target='{$link_target}'" : null;
263
 
@@ -294,7 +295,11 @@ if (!class_exists('rtTPGShortCode')):
294
  <button data-filter="*" class="selected">' . $arg['show_all_text'] . '</button>';
295
  if (!empty($terms) && !is_wp_error($terms)) {
296
  foreach ($terms as $term) {
297
- $html .= "<button data-filter='.iso_{$term->term_id}'>" . $term->name . "</button>";
 
 
 
 
298
  }
299
  }
300
  $html .= '</div>';
@@ -317,13 +322,14 @@ if (!class_exists('rtTPGShortCode')):
317
  $arg['tags'] = get_the_term_list($pID, 'post_tag', null, ', ');
318
  if ($isIsotope) {
319
  $termAs = wp_get_post_terms($pID, $isotope_filter, array("fields" => "all"));
320
- $isoFilter = null;
321
  if (!empty($termAs)) {
322
  foreach ($termAs as $term) {
323
- $isoFilter .= " iso_" . $term->term_id;
 
324
  }
325
  }
326
- $arg['isoFilter'] = $isoFilter;
327
  }
328
  $deptClass = null;
329
  if (!empty($deptAs)) {
80
  $order = isset($scMeta['order']) ? $scMeta['order'] : null;
81
  $s = isset($scMeta['s']) ? $scMeta['s'] : null;
82
  $isotope_filter = isset($scMeta['isotope_filter']) ? $scMeta['isotope_filter'] : null;
83
+ $link = empty($scMeta['link_to_detail_page']) || (!empty($scMeta['link_to_detail_page']) && $scMeta['link_to_detail_page'] === "yes") ? true : false;
84
  $link_target = !empty($scMeta['link_target']) ? $scMeta['link_target'] : null;
85
  } else {
86
  $scMeta = get_post_meta($scID);
111
  $order = isset($scMeta['order'][0]) ? $scMeta['order'][0] : null;
112
  $s = isset($scMeta['s'][0]) ? $scMeta['s'][0] : null;
113
  $isotope_filter = isset($scMeta['isotope_filter'][0]) ? $scMeta['isotope_filter'][0] : null;
114
+ $link = empty($scMeta['link_to_detail_page'][0]) || (!empty($scMeta['link_to_detail_page'][0]) && $scMeta['link_to_detail_page'][0] === "yes") ? true : false;
115
  $link_target = !empty($scMeta['link_target'][0]) ? $scMeta['link_target'][0] : null;
116
 
117
  }
253
  $arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-6 rt-col-xs-12";
254
  }
255
 
256
+ $arg_class = [];
257
+ $arg_class[] = 'rt-equal-height';
258
  if ($isIsotope) {
259
+ $arg_class[] = 'isotope-item';
260
  }
261
+ $arg['class'] = implode(" ", $arg_class);
262
  $arg['link'] = $link;
263
  $arg['link_target'] = $link_target ? " target='{$link_target}'" : null;
264
 
295
  <button data-filter="*" class="selected">' . $arg['show_all_text'] . '</button>';
296
  if (!empty($terms) && !is_wp_error($terms)) {
297
  foreach ($terms as $term) {
298
+ $html .= sprintf('<button class="rt-iso-btn-%s" data-filter=".iso_%d">%s</button>',
299
+ esc_attr($term->slug),
300
+ $term->term_id,
301
+ $term->name
302
+ );
303
  }
304
  }
305
  $html .= '</div>';
322
  $arg['tags'] = get_the_term_list($pID, 'post_tag', null, ', ');
323
  if ($isIsotope) {
324
  $termAs = wp_get_post_terms($pID, $isotope_filter, array("fields" => "all"));
325
+ $isoFilter = [];
326
  if (!empty($termAs)) {
327
  foreach ($termAs as $term) {
328
+ $isoFilter[] = "iso_" . $term->term_id;
329
+ $isoFilter[] = "rt-item-" . esc_attr($term->slug);
330
  }
331
  }
332
+ $arg['isoFilter'] = !empty($isoFilter) ? implode(" ", $isoFilter) : '';
333
  }
334
  $deptClass = null;
335
  if (!empty($deptAs)) {
lib/views/layouts/isotope1.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  /**
 
3
  * @var string $grid
4
  * @var string $pLink
5
  * @var string $class
@@ -15,8 +16,7 @@
15
  * @var array $items
16
  */
17
  $html = null;
18
-
19
- $html .= "<div class='{$grid} {$class} {$isoFilter}'>";
20
  $html .= '<div class="rt-holder">';
21
  if(!empty($imgSrc)) {
22
  $html .= '<div class="rt-img-holder">';
@@ -73,7 +73,7 @@ $html .= "<div class='{$grid} {$class} {$isoFilter}'>";
73
  if(in_array('read_more', $items) && $link){
74
  $html .= sprintf('<div class="read-more"><a href="%s"%s>%s</a></div>', $pLink, $link_target, $read_more_text);
75
  }
76
- $html .= '</div>';
77
  $html .= '</div>';
78
  $html .='</div>';
79
 
1
  <?php
2
  /**
3
+ * @var integer $pID
4
  * @var string $grid
5
  * @var string $pLink
6
  * @var string $class
16
  * @var array $items
17
  */
18
  $html = null;
19
+ $html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", array_filter([$grid, $class, $isoFilter]))), $pID);
 
20
  $html .= '<div class="rt-holder">';
21
  if(!empty($imgSrc)) {
22
  $html .= '<div class="rt-img-holder">';
73
  if(in_array('read_more', $items) && $link){
74
  $html .= sprintf('<div class="read-more"><a href="%s"%s>%s</a></div>', $pLink, $link_target, $read_more_text);
75
  }
76
+ $html .= '</div>';
77
  $html .= '</div>';
78
  $html .='</div>';
79
 
lib/views/layouts/layout1.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  /**
 
3
  * @var string $grid
4
  * @var string $pLink
5
  * @var string $class
@@ -14,7 +15,7 @@
14
  * @var array $items
15
  */
16
  $html = null;
17
- $html .= "<div class='{$grid} {$class}'>";
18
  $html .= '<div class="rt-holder">';
19
  if(!empty($imgSrc)) {
20
  $html .= '<div class="rt-img-holder">';
1
  <?php
2
  /**
3
+ * @var integer $pID
4
  * @var string $grid
5
  * @var string $pLink
6
  * @var string $class
15
  * @var array $items
16
  */
17
  $html = null;
18
+ $html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", [$grid, $class])), $pID);
19
  $html .= '<div class="rt-holder">';
20
  if(!empty($imgSrc)) {
21
  $html .= '<div class="rt-img-holder">';
lib/views/layouts/layout2.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  /**
 
3
  * @var string $grid
4
  * @var string $pLink
5
  * @var string $class
@@ -15,7 +16,7 @@
15
  * @var array $items
16
  */
17
  $html = null;
18
- $html .= "<div class='{$grid} {$class}'>";
19
  $html .= '<div class="rt-holder">';
20
  $html .= '<div class="row">';
21
  if(!empty($imgSrc)) {
1
  <?php
2
  /**
3
+ * @var integer $pID
4
  * @var string $grid
5
  * @var string $pLink
6
  * @var string $class
16
  * @var array $items
17
  */
18
  $html = null;
19
+ $html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", [$grid, $class])), $pID);
20
  $html .= '<div class="rt-holder">';
21
  $html .= '<div class="row">';
22
  if(!empty($imgSrc)) {
lib/views/layouts/layout3.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  /**
 
3
  * @var string $grid
4
  * @var string $pLink
5
  * @var string $class
@@ -16,7 +17,7 @@
16
  */
17
  $html = null;
18
 
19
- $html .= "<div class='{$grid} {$class}'>";
20
  $html .= '<div class="rt-holder">';
21
  $html .= '<div class="row">';
22
  if(!empty($imgSrc)) {
1
  <?php
2
  /**
3
+ * @var integer $pID
4
  * @var string $grid
5
  * @var string $pLink
6
  * @var string $class
17
  */
18
  $html = null;
19
 
20
+ $html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", [$grid, $class])), $pID);
21
  $html .= '<div class="rt-holder">';
22
  $html .= '<div class="row">';
23
  if(!empty($imgSrc)) {
the-post-grid.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://demo.radiustheme.com/wordpress/plugins/the-post-grid/
5
  * Description: Fast & Easy way to display WordPress post in Grid, List & Isotope view ( filter by category, tag, author..) without a single line of coding.
6
  * Author: RadiusTheme
7
- * Version: 2.3.5
8
  * Text Domain: the-post-grid
9
  * Domain Path: /languages
10
  * Author URI: https://radiustheme.com/
4
  * Plugin URI: http://demo.radiustheme.com/wordpress/plugins/the-post-grid/
5
  * Description: Fast & Easy way to display WordPress post in Grid, List & Isotope view ( filter by category, tag, author..) without a single line of coding.
6
  * Author: RadiusTheme
7
+ * Version: 2.3.6
8
  * Text Domain: the-post-grid
9
  * Domain Path: /languages
10
  * Author URI: https://radiustheme.com/