The Post Grid - Version 2.2.6

Version Description

Download this release

Release Info

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

Code changes from version 2.2.5 to 2.2.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
6
  Tested up to: 4.9
7
- Stable tag: 2.2.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -138,6 +138,9 @@ For any bug or suggestion please mail support@radiustheme.com
138
 
139
  == Changelog ==
140
 
 
 
 
141
  = 2.2.5 =
142
  * Add container/ parent class
143
  * Add read more with isotope layout
4
  Tags: post grid, content grid, post display, post format, post view, blog display, news display, post
5
  Requires at least: 4
6
  Tested up to: 4.9
7
+ Stable tag: 2.2.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
138
 
139
  == Changelog ==
140
 
141
+ = 2.2.5 =
142
+ * Add Elementor Widget support
143
+
144
  = 2.2.5 =
145
  * Add container/ parent class
146
  * Add read more with isotope layout
assets/js/rttpg.js CHANGED
@@ -4,36 +4,38 @@
4
  var $isotopeHolder = $(this).find('.tpg-isotope');
5
  var $isotope = $isotopeHolder.find('.rt-tpg-isotope');
6
  if ($isotope.length) {
7
- var isotope = $isotope.imagesLoaded(function () {
8
- $.when(tgpHeightResize()).done(function () {
9
- isotope.isotope({
10
- itemSelector: '.isotope-item',
 
 
 
 
 
11
  });
12
- setTimeout(function () {
13
- isotope.isotope();
14
- }, 100);
15
  });
16
- });
17
- var $isotopeButtonGroup = $isotopeHolder.find('.rt-tpg-isotope-buttons');
18
- $isotopeButtonGroup.on('click', 'button', function (e) {
19
- e.preventDefault();
20
- var filterValue = $(this).attr('data-filter');
21
- isotope.isotope({filter: filterValue});
22
- $(this).parent().find('.selected').removeClass('selected');
23
- $(this).addClass('selected');
24
  });
25
  }
26
  });
27
 
28
 
29
- $(window).on('load resize', function(){
30
  tgpHeightResize();
31
  overlayIconResizeTpg();
32
  });
33
 
34
  function tgpHeightResize() {
35
  var wWidth = $(window).width();
36
- if(wWidth > 767) {
37
  $(".rt-tpg-container").each(function () {
38
  var self = $(this),
39
  rtMaxH = 0;
@@ -49,11 +51,11 @@
49
 
50
  });
51
  });
52
- }else{
53
  $(".rt-tpg-container").find(".rt-equal-height").height('auto');
54
  }
55
  }
56
-
57
  function overlayIconResizeTpg() {
58
  $('.overlay').each(function () {
59
  var holder_height = $(this).height();
4
  var $isotopeHolder = $(this).find('.tpg-isotope');
5
  var $isotope = $isotopeHolder.find('.rt-tpg-isotope');
6
  if ($isotope.length) {
7
+ $(window).on('load resize', function () {
8
+ var isotope = $isotope.imagesLoaded(function () {
9
+ $.when(tgpHeightResize()).done(function () {
10
+ isotope.isotope({
11
+ itemSelector: '.isotope-item',
12
+ });
13
+ setTimeout(function () {
14
+ isotope.isotope();
15
+ }, 100);
16
  });
 
 
 
17
  });
18
+ var $isotopeButtonGroup = $isotopeHolder.find('.rt-tpg-isotope-buttons');
19
+ $isotopeButtonGroup.on('click', 'button', function (e) {
20
+ e.preventDefault();
21
+ var filterValue = $(this).attr('data-filter');
22
+ isotope.isotope({filter: filterValue});
23
+ $(this).parent().find('.selected').removeClass('selected');
24
+ $(this).addClass('selected');
25
+ });
26
  });
27
  }
28
  });
29
 
30
 
31
+ $(window).on('load resize', function () {
32
  tgpHeightResize();
33
  overlayIconResizeTpg();
34
  });
35
 
36
  function tgpHeightResize() {
37
  var wWidth = $(window).width();
38
+ if (wWidth > 767) {
39
  $(".rt-tpg-container").each(function () {
40
  var self = $(this),
41
  rtMaxH = 0;
51
 
52
  });
53
  });
54
+ } else {
55
  $(".rt-tpg-container").find(".rt-equal-height").height('auto');
56
  }
57
  }
58
+
59
  function overlayIconResizeTpg() {
60
  $('.overlay').each(function () {
61
  var holder_height = $(this).height();
lib/classes/rtTPGElementor.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) {
3
+ die;
4
+ }
5
+
6
+ if ( ! class_exists( 'rtTPGElementor' ) ):
7
+
8
+ class rtTPGElementor {
9
+ function __construct() {
10
+ if ( did_action( 'elementor/loaded' ) ) {
11
+ add_action( 'elementor/widgets/widgets_registered', array( $this, 'init' ) );
12
+ }
13
+ }
14
+
15
+ function init() {
16
+ global $rtTPG;
17
+ require_once( $rtTPG->libPath . '/vendor/RtElementorWidget.php' );
18
+
19
+ // Register widget
20
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new RtElementorWidget() );
21
+ }
22
+ }
23
+
24
+ endif;
lib/init.php CHANGED
@@ -6,6 +6,7 @@ if ( ! class_exists( 'rtTPG' ) ) {
6
  public $options;
7
  public $post_type;
8
  public $assetsUrl;
 
9
 
10
  function __construct() {
11
 
6
  public $options;
7
  public $post_type;
8
  public $assetsUrl;
9
+ public $libPath;
10
 
11
  function __construct() {
12
 
lib/vendor/RtElementorWidget.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class RtElementorWidget extends \Elementor\Widget_Base {
4
+
5
+ public function get_name() {
6
+ return 'the-post-grid';
7
+ }
8
+
9
+ public function get_title() {
10
+ return __( 'The Post Grid', 'the-post-grid' );
11
+ }
12
+
13
+ public function get_icon() {
14
+ return 'eicon-gallery-grid';
15
+ }
16
+
17
+ public function get_categories() {
18
+ return [ 'general' ];
19
+ }
20
+
21
+ protected function _register_controls() {
22
+ global $rtTPG;
23
+ $this->start_controls_section(
24
+ 'content_section',
25
+ [
26
+ 'label' => __( 'The Post Grid', 'the-post-grid' ),
27
+ 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
28
+ ]
29
+ );
30
+
31
+ $this->add_control(
32
+ 'post_grid_id',
33
+ array(
34
+ 'type' => \Elementor\Controls_Manager::SELECT2,
35
+ 'id' => 'style',
36
+ 'label' => __( 'Post Grid', 'the-post-grid' ),
37
+ 'options' => $rtTPG->getAllTPGShortCodeList(),
38
+ )
39
+ );
40
+
41
+ $this->end_controls_section();
42
+ }
43
+
44
+ protected function render() {
45
+ $settings = $this->get_settings_for_display();
46
+ if ( isset( $settings['post_grid_id'] ) && ! empty( $settings['post_grid_id'] ) && $id = absint( $settings['post_grid_id'] ) ) {
47
+ echo do_shortcode( '[the-post-grid id="' . $id . '"]' );
48
+ } else {
49
+ echo "Please select a post grid";
50
+ }
51
+ }
52
+ }
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.2.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.2.6
8
  * Text Domain: the-post-grid
9
  * Domain Path: /languages
10
  * Author URI: https://radiustheme.com/