The Post Grid - Version 2.2.61

Version Description

  • Add Gutenberg support
Download this release

Release Info

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

Code changes from version 2.2.6 to 2.2.61

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.6
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 Elementor Widget support
143
 
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.61
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.61 =
142
+ * Add Gutenberg support
143
+
144
  = 2.2.5 =
145
  * Add Elementor Widget support
146
 
assets/images/{rt-tgp-menu.png → rt-tpg-menu.png} RENAMED
File without changes
assets/images/{rt-tgp-sc.png → rt-tpg-sc.png} RENAMED
File without changes
assets/images/{rt-tgp_18.png → rt-tpg_18.png} RENAMED
File without changes
assets/images/{rt-tgp_32.png → rt-tpg_32.png} RENAMED
File without changes
assets/js/post-grid-blocks.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=(r.n(n),r(2)),l=(r.n(o),function(){function e(e,t){var r=[],n=!0,o=!1,l=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,l=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw l}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()),i=wp.i18n.__,a=wp.blocks.registerBlockType,u=wp.components,c=u.SelectControl,s=u.PanelRow,p=wp.editor.InspectorControls;a("rttpg/post-grid",{title:i("Post Grid","the-post-grid"),icon:"grid-view",category:"common",keywords:[i("Post Grid","the-post-grid"),i("post-grid","the-post-grid")],attributes:{gridId:{type:"number",default:0}},edit:function(e){var t=e.attributes.gridId,r=e.setAttributes,n="",o=[{value:0,label:i("Select one","the-post-grid")}];if(rttpgGB.short_codes){var a=!0,u=!1,d=void 0;try{for(var f,m=Object.entries(rttpgGB.short_codes)[Symbol.iterator]();!(a=(f=m.next()).done);a=!0){var g=f.value,b=l(g,2),w=b[0],v=b[1];o.push({value:w,label:v}),t&&Number(w)===t&&(n=v)}}catch(e){u=!0,d=e}finally{try{!a&&m.return&&m.return()}finally{if(u)throw d}}}return[wp.element.createElement(p,null,"This text will show when the box is selected",wp.element.createElement(s,null,wp.element.createElement(c,{label:i("Select a grid:"),options:o,value:t,onChange:function(e){return r({gridId:Number(e)})}}))),wp.element.createElement("div",{className:e.className},t?wp.element.createElement("div",null,wp.element.createElement("span",null,wp.element.createElement("img",{src:rttpgGB.icon}))," ",wp.element.createElement("span",null,i("Post Grid","the-post-grid")," ( ",n," )")):wp.element.createElement("p",null,"Please select a shortcode from block settings"))]},save:function(e){e.attributes.gridId;return null}})},function(e,t){},function(e,t){}]);
lib/classes/rtTPGGutenBurg.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('WPINC')) {
3
+ die;
4
+ }
5
+
6
+ if (!class_exists('rtTPGGutenBurg')):
7
+
8
+ class rtTPGGutenBurg
9
+ {
10
+ function __construct() {
11
+ add_action('enqueue_block_assets', array($this, 'block_assets'));
12
+ add_action('enqueue_block_editor_assets', array($this, 'block_editor_assets'));
13
+ if(function_exists('register_block_type')) {
14
+ register_block_type('rttpg/post-grid', array(
15
+ 'render_callback' => array($this,'render_shortcode'),
16
+ ));
17
+ }
18
+ }
19
+
20
+ static function render_shortcode( $atts ){
21
+ if(!empty($atts['gridId']) && $id = absint($atts['gridId'])){
22
+ return do_shortcode( '[the-post-grid id="' . $id . '"]' );
23
+ }
24
+ }
25
+
26
+
27
+ function block_assets() {
28
+ wp_enqueue_style('wp-blocks');
29
+ }
30
+
31
+ function block_editor_assets() {
32
+ global $rtTPG;
33
+ // Scripts.
34
+ wp_enqueue_script(
35
+ 'rt-tpg-cgb-block-js',
36
+ $rtTPG->assetsUrl . "js/post-grid-blocks.js",
37
+ array('wp-blocks', 'wp-i18n', 'wp-element'),
38
+ (defined('WP_DEBUG') && WP_DEBUG) ? time() : RT_THE_POST_GRID_VERSION,
39
+ true
40
+ );
41
+ wp_localize_script('rt-tpg-cgb-block-js', 'rttpgGB', array(
42
+ 'short_codes' => $rtTPG->getAllTPGShortCodeList(),
43
+ 'icon' => $rtTPG->assetsUrl . 'images/rt-tgp-menu.png',
44
+ ));
45
+ wp_enqueue_style('wp-edit-blocks');
46
+ }
47
+ }
48
+
49
+ endif;
lib/classes/rtTPGInit.php CHANGED
@@ -42,7 +42,7 @@ if ( ! class_exists( 'rtTPGInit' ) ):
42
  '_builtin' => false,
43
  'capability_type' => 'page',
44
  'hierarchical' => true,
45
- 'menu_icon' => $rtTPG->assetsUrl . 'images/rt-tgp-menu.png',
46
  'rewrite' => false,
47
  'query_var' => $rtTPG->post_type,
48
  'supports' => array(
42
  '_builtin' => false,
43
  'capability_type' => 'page',
44
  'hierarchical' => true,
45
+ 'menu_icon' => $rtTPG->assetsUrl . 'images/rt-tpg-menu.png',
46
  'rewrite' => false,
47
  'query_var' => $rtTPG->post_type,
48
  'supports' => array(
lib/classes/rtTPGSCButton.php CHANGED
@@ -28,7 +28,7 @@ if(!class_exists('rtTPGSCButton')):
28
  global $rtTPG;
29
  echo "<style>";
30
  echo "i.mce-i-rt_tpg_scg{";
31
- echo "background: url('".$rtTPG->assetsUrl ."images/rt-tgp-sc.png');";
32
  echo "}";
33
  echo "</style>";
34
  }
28
  global $rtTPG;
29
  echo "<style>";
30
  echo "i.mce-i-rt_tpg_scg{";
31
+ echo "background: url('".$rtTPG->assetsUrl ."images/rt-tpg-sc.png');";
32
  echo "}";
33
  echo "</style>";
34
  }
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.6
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.61
8
  * Text Domain: the-post-grid
9
  * Domain Path: /languages
10
  * Author URI: https://radiustheme.com/