Version Description
- Full Content view
Download this release
Release Info
Developer | techlabpro1 |
Plugin | The Post Grid |
Version | 2.3.2 |
Comparing to | |
See all releases |
Code changes from version 2.3.1 to 2.3.2
- README.txt +5 -2
- assets/js/rttpg.js +50 -35
- languages/the-post-grid.pot +144 -92
- lib/classes/rtTPGHelper.php +45 -36
- lib/classes/rtTPGOptions.php +438 -436
- lib/classes/rtTPGShortCode.php +464 -459
- the-post-grid.php +1 -1
README.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: techlabpro1
|
|
3 |
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.
|
7 |
-
Stable tag: 2.3.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -139,6 +139,9 @@ For any bug or suggestion please mail support@radiustheme.com
|
|
139 |
|
140 |
== Changelog ==
|
141 |
|
|
|
|
|
|
|
142 |
= 2.3.1 =
|
143 |
* Bug fix for limit
|
144 |
* Fix Some CSS issue
|
3 |
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.3
|
7 |
+
Stable tag: 2.3.2
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
139 |
|
140 |
== Changelog ==
|
141 |
|
142 |
+
= 2.3.2 =
|
143 |
+
* Full Content view
|
144 |
+
|
145 |
= 2.3.1 =
|
146 |
* Bug fix for limit
|
147 |
* Fix Some CSS issue
|
assets/js/rttpg.js
CHANGED
@@ -1,52 +1,65 @@
|
|
1 |
(function ($) {
|
2 |
'use strict';
|
3 |
|
4 |
-
window.tpgFixLazyLoad = function () {
|
5 |
$('.rt-tpg-container').each(function () {
|
6 |
// jetpack Lazy load
|
7 |
$(this).find('img.jetpack-lazy-image:not(.jetpack-lazy-image--handled)').each(function () {
|
8 |
$(this).addClass('jetpack-lazy-image--handled').removeAttr('srcset').removeAttr('data-lazy-src').attr('data-lazy-loaded', 1);
|
9 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
});
|
11 |
};
|
12 |
|
13 |
window.initTpg = function () {
|
14 |
$(".rt-tpg-container").each(function () {
|
|
|
15 |
var $isotopeHolder = $(this).find('.tpg-isotope');
|
16 |
var $isotope = $isotopeHolder.find('.rt-tpg-isotope');
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
23 |
itemSelector: '.isotope-item',
|
24 |
});
|
|
|
25 |
setTimeout(function () {
|
26 |
-
isotope.isotope();
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
});
|
39 |
-
}
|
40 |
-
tgpHeightResize();
|
41 |
-
overlayIconResizeTpg();
|
42 |
-
$isotopeHolder.trigger("tpg_loaded");
|
43 |
});
|
44 |
};
|
45 |
initTpg();
|
46 |
-
$(window).on('
|
|
|
|
|
|
|
|
|
47 |
tgpHeightResize();
|
48 |
overlayIconResizeTpg();
|
49 |
-
$(".rt-tpg-container").trigger("tpg_loaded");
|
50 |
});
|
51 |
|
52 |
function tgpHeightResize() {
|
@@ -73,16 +86,18 @@
|
|
73 |
}
|
74 |
|
75 |
function overlayIconResizeTpg() {
|
76 |
-
$(
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
86 |
});
|
87 |
}
|
88 |
|
1 |
(function ($) {
|
2 |
'use strict';
|
3 |
|
4 |
+
window.tpgFixLazyLoad = function ($item) {
|
5 |
$('.rt-tpg-container').each(function () {
|
6 |
// jetpack Lazy load
|
7 |
$(this).find('img.jetpack-lazy-image:not(.jetpack-lazy-image--handled)').each(function () {
|
8 |
$(this).addClass('jetpack-lazy-image--handled').removeAttr('srcset').removeAttr('data-lazy-src').attr('data-lazy-loaded', 1);
|
9 |
});
|
10 |
+
|
11 |
+
//
|
12 |
+
$(this).find('img.lazyload').each(function () {
|
13 |
+
var src = $(this).attr('data-src') || '';
|
14 |
+
if (src) {
|
15 |
+
$(this).attr('src', src).removeClass('lazyload').addClass('lazyloaded');
|
16 |
+
}
|
17 |
+
});
|
18 |
});
|
19 |
};
|
20 |
|
21 |
window.initTpg = function () {
|
22 |
$(".rt-tpg-container").each(function () {
|
23 |
+
var _item = $(this);
|
24 |
var $isotopeHolder = $(this).find('.tpg-isotope');
|
25 |
var $isotope = $isotopeHolder.find('.rt-tpg-isotope');
|
26 |
+
$isotopeHolder.trigger('tpg_item_before_load');
|
27 |
+
tpgFixLazyLoad();
|
28 |
+
setTimeout(function () {
|
29 |
+
_item.imagesLoaded().progress(function (instance, image) {
|
30 |
+
_item.trigger('tpg_image_loading');
|
31 |
+
}).done(function (instance) {
|
32 |
+
_item.trigger('tpg_item_before_load');
|
33 |
+
if ($isotope.length) {
|
34 |
+
$isotope.isotope({
|
35 |
itemSelector: '.isotope-item',
|
36 |
});
|
37 |
+
_item.trigger('tpg_item_after_load');
|
38 |
setTimeout(function () {
|
39 |
+
$isotope.isotope();
|
40 |
+
}, 10);
|
41 |
+
var $isotopeButtonGroup = $isotopeHolder.find('.rt-tpg-isotope-buttons');
|
42 |
+
$isotopeButtonGroup.on('click', 'button', function (e) {
|
43 |
+
e.preventDefault();
|
44 |
+
var filterValue = $(this).attr('data-filter');
|
45 |
+
$isotope.isotope({filter: filterValue});
|
46 |
+
$(this).parent().find('.selected').removeClass('selected');
|
47 |
+
$(this).addClass('selected');
|
48 |
+
});
|
49 |
+
}
|
50 |
+
_item.trigger("tpg_loaded");
|
51 |
});
|
52 |
+
}, 10);
|
|
|
|
|
|
|
53 |
});
|
54 |
};
|
55 |
initTpg();
|
56 |
+
$(window).on('resize', function () {
|
57 |
+
$(".rt-tpg-container").trigger("tpg_loaded");
|
58 |
+
});
|
59 |
+
|
60 |
+
$('.rt-tpg-container').on('tpg_loaded tpg_item_after_load', function () {
|
61 |
tgpHeightResize();
|
62 |
overlayIconResizeTpg();
|
|
|
63 |
});
|
64 |
|
65 |
function tgpHeightResize() {
|
86 |
}
|
87 |
|
88 |
function overlayIconResizeTpg() {
|
89 |
+
$(".rt-tpg-container").each(function () {
|
90 |
+
$(this).find('.overlay').each(function () {
|
91 |
+
var holder_height = $(this).height();
|
92 |
+
var target = $(this).children('.link-holder');
|
93 |
+
var targetd = $(this).children('.view-details');
|
94 |
+
var a_height = target.height();
|
95 |
+
var ad_height = targetd.height();
|
96 |
+
var h = (holder_height - a_height) / 2;
|
97 |
+
var hd = (holder_height - ad_height) / 2;
|
98 |
+
target.css('top', h + 'px');
|
99 |
+
targetd.css('margin-top', hd + 'px');
|
100 |
+
});
|
101 |
});
|
102 |
}
|
103 |
|
languages/the-post-grid.pot
CHANGED
@@ -3,14 +3,14 @@ msgid ""
|
|
3 |
msgstr ""
|
4 |
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
5 |
"Project-Id-Version: The Post Grid\n"
|
6 |
-
"POT-Creation-Date:
|
7 |
-
"PO-Revision-Date:
|
8 |
"Last-Translator: \n"
|
9 |
"Language-Team: \n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"X-Generator: Poedit 1.8.
|
14 |
"X-Poedit-Basepath: ..\n"
|
15 |
"X-Poedit-WPHeader: the-post-grid.php\n"
|
16 |
"X-Poedit-SourceCharset: UTF-8\n"
|
@@ -20,243 +20,295 @@ msgstr ""
|
|
20 |
"X-Poedit-SearchPath-0: .\n"
|
21 |
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
22 |
|
23 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
24 |
msgid "Settings successfully updated"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
28 |
msgid "Security Error !!"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
32 |
msgid "<div class=\"field-holder\">No Taxonomy found</div>"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
36 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
37 |
msgid "Security error"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
41 |
msgid "Select Short code"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
45 |
msgid "Default"
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
49 |
msgid "No shortCode found."
|
50 |
msgstr ""
|
51 |
|
52 |
#. Plugin Name of the plugin/theme
|
53 |
-
#: lib/classes/rtTPGInit.php:
|
|
|
|
|
54 |
msgid "The Post Grid"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: lib/classes/rtTPGInit.php:
|
58 |
msgid "Add New Grid"
|
59 |
msgstr ""
|
60 |
|
61 |
-
#: lib/classes/rtTPGInit.php:
|
62 |
msgid "All Grids"
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: lib/classes/rtTPGInit.php:
|
66 |
msgid "Add New Post Grid"
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: lib/classes/rtTPGInit.php:
|
70 |
msgid "Edit Post Grid"
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: lib/classes/rtTPGInit.php:
|
74 |
msgid "New Post Grid"
|
75 |
msgstr ""
|
76 |
|
77 |
-
#: lib/classes/rtTPGInit.php:
|
78 |
msgid "View Post Grid"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: lib/classes/rtTPGInit.php:
|
82 |
msgid "Search Post Grids"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: lib/classes/rtTPGInit.php:
|
86 |
msgid "No Post Grids found"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: lib/classes/rtTPGInit.php:
|
90 |
msgid "No Post Grids found in Trash"
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: lib/classes/rtTPGInit.php:
|
94 |
msgid "Settings"
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: lib/classes/
|
98 |
-
msgid "
|
99 |
-
msgstr ""
|
100 |
-
|
101 |
-
#: lib/classes/rtTPGInit.php:157
|
102 |
-
msgid "Custom field updated."
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: lib/classes/
|
106 |
-
msgid "
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: lib/classes/
|
110 |
-
|
111 |
-
msgid "Field group restored to revision from %s"
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: lib/classes/
|
115 |
-
msgid "
|
116 |
msgstr ""
|
117 |
|
118 |
-
#: lib/classes/
|
119 |
-
msgid "
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: lib/classes/
|
123 |
-
msgid "
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: lib/classes/
|
127 |
-
msgid "Field
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: lib/classes/
|
131 |
-
msgid "
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: lib/classes/
|
135 |
-
msgid "
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: lib/classes/
|
139 |
-
msgid "
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: lib/classes/
|
143 |
-
msgid "
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: lib/classes/
|
147 |
-
msgid "
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: lib/classes/
|
151 |
-
msgid "
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: lib/classes/
|
155 |
-
msgid "
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: lib/classes/rtTPGOptions.php:
|
159 |
-
msgid "
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: lib/classes/rtTPGOptions.php:
|
163 |
-
|
|
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: lib/classes/rtTPGOptions.php:
|
167 |
-
msgid "
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: lib/classes/rtTPGOptions.php:
|
171 |
msgid ""
|
172 |
"If value of Limit setting is not blank (empty), this value should be smaller "
|
173 |
"than Limit value."
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: lib/classes/rtTPGOptions.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
msgid ""
|
178 |
"Excerpt limit only integer number is allowed, Leave it blank for full "
|
179 |
"excerpt. Note: This will remove all html tag"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: lib/classes/rtTPGOptions.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
msgid "Feature Image"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: lib/classes/rtTPGOptions.php:
|
187 |
msgid "First Image from content"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: lib/classes/rtTPGOptions.php:
|
191 |
msgid "Title"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: lib/classes/rtTPGOptions.php:
|
195 |
msgid "Excerpt"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: lib/classes/rtTPGOptions.php:
|
|
|
199 |
msgid "Read More"
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: lib/classes/rtTPGOptions.php:
|
203 |
msgid "Post Date"
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: lib/classes/rtTPGOptions.php:
|
207 |
msgid "Author"
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: lib/classes/rtTPGOptions.php:
|
211 |
msgid "Categories"
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: lib/classes/rtTPGOptions.php:
|
215 |
msgid "Tags"
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: lib/classes/rtTPGOptions.php:
|
219 |
msgid "Comment Count"
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: lib/classes/rtTPGShortCode.php:
|
223 |
-
msgid "
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: lib/classes/rtTPGShortCode.php:
|
227 |
-
msgid "
|
|
|
|
|
|
|
|
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: lib/
|
231 |
-
msgid "
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: lib/views/settings/settings.php:
|
235 |
msgid "The Post Grid Settings"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: lib/views/settings/settings.php:
|
239 |
msgid "General settings"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: lib/views/settings/settings.php:
|
243 |
msgid "Documentation"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: lib/
|
247 |
-
msgid "
|
248 |
-
msgstr ""
|
249 |
-
|
250 |
-
#: lib/views/settings/settings.php:54
|
251 |
-
msgid "id = short code id (1,2,3,4)"
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: lib/
|
255 |
-
msgid "
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: lib/
|
259 |
-
msgid "
|
260 |
msgstr ""
|
261 |
|
262 |
#. Plugin URI of the plugin/theme
|
3 |
msgstr ""
|
4 |
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
5 |
"Project-Id-Version: The Post Grid\n"
|
6 |
+
"POT-Creation-Date: 2019-08-26 12:13+0600\n"
|
7 |
+
"PO-Revision-Date: 2019-08-26 12:12+0600\n"
|
8 |
"Last-Translator: \n"
|
9 |
"Language-Team: \n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Generator: Poedit 1.8.7\n"
|
14 |
"X-Poedit-Basepath: ..\n"
|
15 |
"X-Poedit-WPHeader: the-post-grid.php\n"
|
16 |
"X-Poedit-SourceCharset: UTF-8\n"
|
20 |
"X-Poedit-SearchPath-0: .\n"
|
21 |
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
22 |
|
23 |
+
#: lib/classes/rtTPGAjaxResponse.php:26
|
24 |
msgid "Settings successfully updated"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: lib/classes/rtTPGAjaxResponse.php:28
|
28 |
msgid "Security Error !!"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: lib/classes/rtTPGAjaxResponse.php:56
|
32 |
msgid "<div class=\"field-holder\">No Taxonomy found</div>"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: lib/classes/rtTPGAjaxResponse.php:60 lib/classes/rtTPGAjaxResponse.php:79
|
36 |
+
#: lib/classes/rtTPGAjaxResponse.php:118
|
37 |
msgid "Security error"
|
38 |
msgstr ""
|
39 |
|
40 |
+
#: lib/classes/rtTPGAjaxResponse.php:137
|
41 |
msgid "Select Short code"
|
42 |
msgstr ""
|
43 |
|
44 |
+
#: lib/classes/rtTPGAjaxResponse.php:139
|
45 |
msgid "Default"
|
46 |
msgstr ""
|
47 |
|
48 |
+
#: lib/classes/rtTPGAjaxResponse.php:148
|
49 |
msgid "No shortCode found."
|
50 |
msgstr ""
|
51 |
|
52 |
#. Plugin Name of the plugin/theme
|
53 |
+
#: lib/classes/rtTPGInit.php:22 lib/classes/rtTPGInit.php:23
|
54 |
+
#: lib/vendor/RtElementorWidget.php:10 lib/vendor/RtElementorWidget.php:26
|
55 |
+
#: lib/widgets/RT_TPGWidget.php:15
|
56 |
msgid "The Post Grid"
|
57 |
msgstr ""
|
58 |
|
59 |
+
#: lib/classes/rtTPGInit.php:24
|
60 |
msgid "Add New Grid"
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: lib/classes/rtTPGInit.php:25
|
64 |
msgid "All Grids"
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: lib/classes/rtTPGInit.php:26
|
68 |
msgid "Add New Post Grid"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: lib/classes/rtTPGInit.php:27
|
72 |
msgid "Edit Post Grid"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: lib/classes/rtTPGInit.php:28
|
76 |
msgid "New Post Grid"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: lib/classes/rtTPGInit.php:29
|
80 |
msgid "View Post Grid"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: lib/classes/rtTPGInit.php:30
|
84 |
msgid "Search Post Grids"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: lib/classes/rtTPGInit.php:31
|
88 |
msgid "No Post Grids found"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: lib/classes/rtTPGInit.php:32
|
92 |
msgid "No Post Grids found in Trash"
|
93 |
msgstr ""
|
94 |
|
95 |
+
#: lib/classes/rtTPGInit.php:112
|
96 |
msgid "Settings"
|
97 |
msgstr ""
|
98 |
|
99 |
+
#: lib/classes/rtTPGMeta.php:27
|
100 |
+
msgid "Shortcode"
|
|
|
|
|
|
|
|
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: lib/classes/rtTPGMeta.php:85
|
104 |
+
msgid "Short Code Generator"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: lib/classes/rtTPGMeta.php:92
|
108 |
+
msgid "Pro Features"
|
|
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: lib/classes/rtTPGMeta.php:99
|
112 |
+
msgid "Layout Preview"
|
113 |
msgstr ""
|
114 |
|
115 |
+
#: lib/classes/rtTPGMeta.php:141
|
116 |
+
msgid "Post Source"
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: lib/classes/rtTPGMeta.php:142
|
120 |
+
msgid "Layout Settings"
|
121 |
msgstr ""
|
122 |
|
123 |
+
#: lib/classes/rtTPGMeta.php:143
|
124 |
+
msgid "Field Selection"
|
125 |
msgstr ""
|
126 |
|
127 |
+
#: lib/classes/rtTPGMeta.php:144
|
128 |
+
msgid "Style"
|
129 |
msgstr ""
|
130 |
|
131 |
+
#: lib/classes/rtTPGOptions.php:69
|
132 |
+
msgid "Script before item load"
|
133 |
msgstr ""
|
134 |
|
135 |
+
#: lib/classes/rtTPGOptions.php:77
|
136 |
+
msgid "Script After item load"
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: lib/classes/rtTPGOptions.php:85
|
140 |
+
msgid "After Loaded Script"
|
141 |
msgstr ""
|
142 |
|
143 |
+
#: lib/classes/rtTPGOptions.php:101
|
144 |
+
msgid "List of post IDs to show (comma-separated values, for example: 1,2,3)"
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: lib/classes/rtTPGOptions.php:109
|
148 |
+
msgid "List of post IDs to hide (comma-separated values, for example: 1,2,3)"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: lib/classes/rtTPGOptions.php:117
|
152 |
+
msgid "The number of posts to show. Set empty to show all found posts."
|
153 |
msgstr ""
|
154 |
|
155 |
+
#: lib/classes/rtTPGOptions.php:190
|
156 |
+
msgid "Show all text"
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: lib/classes/rtTPGOptions.php:191 lib/classes/rtTPGShortCode.php:71
|
160 |
+
#: lib/classes/rtTPGShortCode.php:100
|
161 |
+
msgid "Show all"
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: lib/classes/rtTPGOptions.php:197
|
165 |
+
msgid "Image column"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: lib/classes/rtTPGOptions.php:228
|
169 |
msgid ""
|
170 |
"If value of Limit setting is not blank (empty), this value should be smaller "
|
171 |
"than Limit value."
|
172 |
msgstr ""
|
173 |
|
174 |
+
#: lib/classes/rtTPGOptions.php:261
|
175 |
+
msgid "Title limit"
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: lib/classes/rtTPGOptions.php:262
|
179 |
+
msgid ""
|
180 |
+
"Title limit only integer number is allowed, Leave it blank for full title."
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
+
#: lib/classes/rtTPGOptions.php:268
|
184 |
+
msgid "Title limit type"
|
185 |
+
msgstr ""
|
186 |
+
|
187 |
+
#: lib/classes/rtTPGOptions.php:276
|
188 |
+
msgid "Excerpt limit"
|
189 |
+
msgstr ""
|
190 |
+
|
191 |
+
#: lib/classes/rtTPGOptions.php:278
|
192 |
msgid ""
|
193 |
"Excerpt limit only integer number is allowed, Leave it blank for full "
|
194 |
"excerpt. Note: This will remove all html tag"
|
195 |
msgstr ""
|
196 |
|
197 |
+
#: lib/classes/rtTPGOptions.php:283
|
198 |
+
msgid "Excerpt Type"
|
199 |
+
msgstr ""
|
200 |
+
|
201 |
+
#: lib/classes/rtTPGOptions.php:292
|
202 |
+
msgid "Excerpt more text"
|
203 |
+
msgstr ""
|
204 |
+
|
205 |
+
#: lib/classes/rtTPGOptions.php:299
|
206 |
+
msgid "Read more text"
|
207 |
+
msgstr ""
|
208 |
+
|
209 |
+
#: lib/classes/rtTPGOptions.php:306
|
210 |
+
msgid "Overlay"
|
211 |
+
msgstr ""
|
212 |
+
|
213 |
+
#: lib/classes/rtTPGOptions.php:313
|
214 |
+
msgid "Title tag"
|
215 |
+
msgstr ""
|
216 |
+
|
217 |
+
#: lib/classes/rtTPGOptions.php:380
|
218 |
+
msgid "Title color"
|
219 |
+
msgstr ""
|
220 |
+
|
221 |
+
#: lib/classes/rtTPGOptions.php:387
|
222 |
+
msgid "Title hover color"
|
223 |
+
msgstr ""
|
224 |
+
|
225 |
+
#: lib/classes/rtTPGOptions.php:396
|
226 |
+
msgid "Read more button border radius"
|
227 |
+
msgstr ""
|
228 |
+
|
229 |
+
#: lib/classes/rtTPGOptions.php:397
|
230 |
+
msgid "Leave it blank for default"
|
231 |
+
msgstr ""
|
232 |
+
|
233 |
+
#: lib/classes/rtTPGOptions.php:426
|
234 |
msgid "Feature Image"
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: lib/classes/rtTPGOptions.php:427
|
238 |
msgid "First Image from content"
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: lib/classes/rtTPGOptions.php:455
|
242 |
msgid "Title"
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: lib/classes/rtTPGOptions.php:456
|
246 |
msgid "Excerpt"
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: lib/classes/rtTPGOptions.php:457 lib/classes/rtTPGShortCode.php:69
|
250 |
+
#: lib/classes/rtTPGShortCode.php:98
|
251 |
msgid "Read More"
|
252 |
msgstr ""
|
253 |
|
254 |
+
#: lib/classes/rtTPGOptions.php:458
|
255 |
msgid "Post Date"
|
256 |
msgstr ""
|
257 |
|
258 |
+
#: lib/classes/rtTPGOptions.php:459
|
259 |
msgid "Author"
|
260 |
msgstr ""
|
261 |
|
262 |
+
#: lib/classes/rtTPGOptions.php:460
|
263 |
msgid "Categories"
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: lib/classes/rtTPGOptions.php:461
|
267 |
msgid "Tags"
|
268 |
msgstr ""
|
269 |
|
270 |
+
#: lib/classes/rtTPGOptions.php:462
|
271 |
msgid "Comment Count"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: lib/classes/rtTPGShortCode.php:342
|
275 |
+
msgid "No post found"
|
276 |
msgstr ""
|
277 |
|
278 |
+
#: lib/classes/rtTPGShortCode.php:370
|
279 |
+
msgid "Session Error !!"
|
280 |
+
msgstr ""
|
281 |
+
|
282 |
+
#: lib/classes/rtTPGShortCode.php:372
|
283 |
+
msgid "No shortCode found"
|
284 |
msgstr ""
|
285 |
|
286 |
+
#: lib/vendor/RtElementorWidget.php:36
|
287 |
+
msgid "Post Grid"
|
288 |
msgstr ""
|
289 |
|
290 |
+
#: lib/views/settings/settings.php:5
|
291 |
msgid "The Post Grid Settings"
|
292 |
msgstr ""
|
293 |
|
294 |
+
#: lib/views/settings/settings.php:6
|
295 |
msgid "General settings"
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: lib/views/settings/settings.php:9
|
299 |
msgid "Documentation"
|
300 |
msgstr ""
|
301 |
|
302 |
+
#: lib/widgets/RT_TPGWidget.php:14
|
303 |
+
msgid "Display the post grid."
|
|
|
|
|
|
|
|
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: lib/widgets/RT_TPGWidget.php:46
|
307 |
+
msgid "Title:"
|
308 |
msgstr ""
|
309 |
|
310 |
+
#: lib/widgets/RT_TPGWidget.php:52
|
311 |
+
msgid "Select post grid"
|
312 |
msgstr ""
|
313 |
|
314 |
#. Plugin URI of the plugin/theme
|
lib/classes/rtTPGHelper.php
CHANGED
@@ -226,48 +226,57 @@ if ( ! class_exists( 'rtTPGHelper' ) ):
|
|
226 |
}
|
227 |
|
228 |
function get_the_excerpt( $post_id, $data = array() ) {
|
229 |
-
$
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
$
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
} else {
|
247 |
-
$excerpt
|
|
|
|
|
|
|
248 |
}
|
249 |
} else {
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
}
|
255 |
-
|
256 |
-
$allowed_html = array(
|
257 |
-
'a' => array(
|
258 |
-
'href' => array(),
|
259 |
-
'title' => array()
|
260 |
-
),
|
261 |
-
'strong' => array(),
|
262 |
-
'b' => array(),
|
263 |
-
'br' => array( array() ),
|
264 |
-
);
|
265 |
-
$excerpt = nl2br( wp_kses( $excerpt, $allowed_html ) );
|
266 |
-
}
|
267 |
-
$excerpt = ( $more ? $excerpt . " " . $more : $excerpt );
|
268 |
|
269 |
|
270 |
-
|
|
|
271 |
}
|
272 |
|
273 |
|
226 |
}
|
227 |
|
228 |
function get_the_excerpt( $post_id, $data = array() ) {
|
229 |
+
$type = $data['excerpt_type'];
|
230 |
+
if ( $type == 'full' ) {
|
231 |
+
ob_start();
|
232 |
+
the_content();
|
233 |
+
$content = ob_get_clean();
|
234 |
+
|
235 |
+
return apply_filters( 'tpg_content_full', $content, $post_id, $data );
|
236 |
+
} else {
|
237 |
+
|
238 |
+
$limit = isset( $data['excerpt_limit'] ) ? abs( $data['excerpt_limit'] ) : 0;
|
239 |
+
$defaultExcerpt = get_the_excerpt( $post_id );
|
240 |
+
$more = $data['excerpt_more_text'];
|
241 |
+
$excerpt = preg_replace( '`\[[^\]]*\]`', '', $defaultExcerpt );
|
242 |
+
$excerpt = strip_shortcodes( $excerpt );
|
243 |
+
$excerpt = preg_replace( '`[[^]]*]`', '', $excerpt );
|
244 |
+
$excerpt = str_replace( '…', '', $excerpt );
|
245 |
+
if ( $limit ) {
|
246 |
+
$excerpt = wp_filter_nohtml_kses( $excerpt );
|
247 |
+
if ( $type == "word" ) {
|
248 |
+
$limit = $limit + 1;
|
249 |
+
$rawExcerpt = $excerpt;
|
250 |
+
$excerpt = explode( ' ', $excerpt, $limit );
|
251 |
+
if ( count( $excerpt ) >= $limit ) {
|
252 |
+
array_pop( $excerpt );
|
253 |
+
$excerpt = implode( " ", $excerpt );
|
254 |
+
} else {
|
255 |
+
$excerpt = $rawExcerpt;
|
256 |
+
}
|
257 |
} else {
|
258 |
+
if ( $limit > 0 && strlen( $excerpt ) > $limit ) {
|
259 |
+
$excerpt = mb_substr( $excerpt, 0, $limit, "utf-8" );
|
260 |
+
$excerpt = preg_replace( '/\W\w+\s*(\W*)$/', '$1', $excerpt );
|
261 |
+
}
|
262 |
}
|
263 |
} else {
|
264 |
+
$allowed_html = array(
|
265 |
+
'a' => array(
|
266 |
+
'href' => array(),
|
267 |
+
'title' => array()
|
268 |
+
),
|
269 |
+
'strong' => array(),
|
270 |
+
'b' => array(),
|
271 |
+
'br' => array( array() ),
|
272 |
+
);
|
273 |
+
$excerpt = nl2br( wp_kses( $excerpt, $allowed_html ) );
|
274 |
}
|
275 |
+
$excerpt = ( $more ? $excerpt . " " . $more : $excerpt );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
|
277 |
|
278 |
+
return apply_filters( 'tpg_get_the_excerpt', $excerpt, $post_id, $data, $defaultExcerpt );
|
279 |
+
}
|
280 |
}
|
281 |
|
282 |
|
lib/classes/rtTPGOptions.php
CHANGED
@@ -1,468 +1,470 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (!class_exists('rtTPGOptions')):
|
4 |
|
5 |
-
|
6 |
-
{
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
|
165 |
-
|
166 |
-
|
167 |
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
|
|
|
|
|
|
327 |
|
328 |
-
|
329 |
-
|
330 |
|
331 |
-
|
332 |
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
|
401 |
-
|
402 |
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
|
450 |
-
|
451 |
-
|
452 |
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
|
466 |
-
|
467 |
|
468 |
endif;
|
1 |
<?php
|
2 |
|
3 |
+
if ( ! class_exists( 'rtTPGOptions' ) ):
|
4 |
|
5 |
+
class rtTPGOptions {
|
|
|
6 |
|
7 |
+
function rtPostTypes() {
|
8 |
+
$post_types = get_post_types(
|
9 |
+
array(
|
10 |
+
'_builtin' => true
|
11 |
+
)
|
12 |
+
);
|
13 |
+
$exclude = array( 'attachment', 'revision', 'nav_menu_item' );
|
14 |
+
foreach ( $exclude as $ex ) {
|
15 |
+
unset( $post_types[ $ex ] );
|
16 |
+
}
|
17 |
|
18 |
+
return $post_types;
|
19 |
+
}
|
20 |
|
21 |
+
function rtPostOrders() {
|
22 |
+
return array(
|
23 |
+
"ASC" => "Ascending",
|
24 |
+
"DESC" => "Descending",
|
25 |
+
);
|
26 |
+
}
|
27 |
|
28 |
+
function rtTermOperators() {
|
29 |
+
return array(
|
30 |
+
'IN' => "IN — show posts which associate with one or more of selected terms",
|
31 |
+
'NOT IN' => "NOT IN — show posts which do not associate with any of selected terms",
|
32 |
+
'AND' => "AND — show posts which associate with all of selected terms",
|
33 |
+
);
|
34 |
+
}
|
35 |
|
36 |
+
function rtTermRelations() {
|
37 |
+
return array(
|
38 |
+
'AND' => "AND — show posts which match all settings",
|
39 |
+
'OR' => "OR — show posts which match one or more settings",
|
40 |
+
);
|
41 |
+
}
|
42 |
|
43 |
+
function rtPostOrderBy() {
|
44 |
+
return array(
|
45 |
+
"ID" => "ID",
|
46 |
+
"title" => "Title",
|
47 |
+
"date" => "Created date",
|
48 |
+
"modified" => "Modified date",
|
49 |
+
"menu_order" => "Menu Order"
|
50 |
+
);
|
51 |
+
}
|
52 |
|
53 |
+
function rtTPGSettingFields() {
|
54 |
+
global $rtTPG;
|
55 |
+
$settings = get_option( $rtTPG->options['settings'] );
|
56 |
|
57 |
+
return array(
|
58 |
+
'custom_css' => array(
|
59 |
+
'type' => 'textarea',
|
60 |
+
'name' => 'custom_css',
|
61 |
+
'label' => 'Custom Css',
|
62 |
+
'holderClass' => 'rt-script-wrapper full',
|
63 |
+
'id' => 'custom-css',
|
64 |
+
'value' => isset( $settings['custom_css'] ) ? stripslashes( $settings['custom_css'] ) : null,
|
65 |
+
),
|
66 |
+
"script_before_item_load" => array(
|
67 |
+
'name' => 'script_before_item_load',
|
68 |
+
"label" => __( "Script before item load", 'the-post-grid' ),
|
69 |
+
'type' => 'textarea',
|
70 |
+
'holderClass' => 'rt-script-wrapper full',
|
71 |
+
'id' => 'script-before-item-load',
|
72 |
+
'value' => isset( $settings['script_before_item_load'] ) ? stripslashes( $settings['script_before_item_load'] ) : null
|
73 |
+
),
|
74 |
+
"script_after_item_load" => array(
|
75 |
+
'name' => 'script_after_item_load',
|
76 |
+
"label" => __( "Script After item load", 'the-post-grid' ),
|
77 |
+
'type' => 'textarea',
|
78 |
+
'holderClass' => 'rt-script-wrapper full',
|
79 |
+
'id' => 'script-after-item-load',
|
80 |
+
'value' => isset( $settings['script_after_item_load'] ) ? stripslashes( $settings['script_after_item_load'] ) : null
|
81 |
+
),
|
82 |
+
"script_loaded" => array(
|
83 |
+
'name' => 'script_loaded',
|
84 |
+
"label" => __( "After Loaded Script", 'the-post-grid' ),
|
85 |
+
'type' => 'textarea',
|
86 |
+
'holderClass' => 'rt-script-wrapper full',
|
87 |
+
'id' => 'script-loaded',
|
88 |
+
'value' => isset( $settings['script_loaded'] ) ? stripslashes( $settings['script_loaded'] ) : null
|
89 |
+
)
|
90 |
+
);
|
91 |
+
}
|
92 |
|
93 |
+
function rtTPGCommonFilterFields() {
|
94 |
+
return array(
|
95 |
+
'post__in' => array(
|
96 |
+
"name" => "post__in",
|
97 |
+
"label" => "Include only",
|
98 |
+
"type" => "text",
|
99 |
+
"class" => "full",
|
100 |
+
"description" => __( 'List of post IDs to show (comma-separated values, for example: 1,2,3)',
|
101 |
+
'the-post-grid' )
|
102 |
+
),
|
103 |
+
'post__not_in' => array(
|
104 |
+
"name" => "post__not_in",
|
105 |
+
"label" => "Exclude",
|
106 |
+
"type" => "text",
|
107 |
+
"class" => "full",
|
108 |
+
"description" => __( 'List of post IDs to hide (comma-separated values, for example: 1,2,3)',
|
109 |
+
'the-post-grid' )
|
110 |
+
),
|
111 |
+
'limit' => array(
|
112 |
+
"name" => "limit",
|
113 |
+
"label" => "Limit",
|
114 |
+
"type" => "number",
|
115 |
+
"class" => "full",
|
116 |
+
"description" => __( 'The number of posts to show. Set empty to show all found posts.',
|
117 |
+
'the-post-grid' )
|
118 |
+
)
|
119 |
+
);
|
120 |
+
}
|
121 |
|
122 |
+
function rtTPGPostType() {
|
123 |
+
return array(
|
124 |
+
"name" => "tpg_post_type",
|
125 |
+
"label" => "Post Type",
|
126 |
+
"type" => "select",
|
127 |
+
"id" => "rc-sc-post-type",
|
128 |
+
"class" => "rt-select2",
|
129 |
+
"options" => $this->rtPostTypes()
|
130 |
+
);
|
131 |
+
}
|
132 |
|
133 |
+
function rtTPAdvanceFilters() {
|
134 |
+
return array(
|
135 |
+
'type' => "checkbox",
|
136 |
+
'name' => "post_filter",
|
137 |
+
'label' => "Advanced filters",
|
138 |
+
'id' => "post_filter",
|
139 |
+
"alignment" => "vertical",
|
140 |
+
"multiple" => true,
|
141 |
+
"options" => array(
|
142 |
+
'tpg_taxonomy' => "Taxonomy",
|
143 |
+
'order' => "Order",
|
144 |
+
'author' => "Author",
|
145 |
+
'tpg_post_status' => "Status",
|
146 |
+
's' => "Search"
|
147 |
+
),
|
148 |
+
);
|
149 |
+
}
|
150 |
|
151 |
+
function rtTPGPostStatus() {
|
152 |
+
return array(
|
153 |
+
'publish' => 'Publish',
|
154 |
+
'pending' => 'Pending',
|
155 |
+
'draft' => 'Draft',
|
156 |
+
'auto-draft' => 'Auto draft',
|
157 |
+
'future' => 'Future',
|
158 |
+
'private' => 'Private',
|
159 |
+
'inherit' => 'Inherit',
|
160 |
+
'trash' => 'Trash',
|
161 |
+
);
|
162 |
+
}
|
163 |
|
164 |
+
function rtTPGLayoutSettingFields() {
|
165 |
+
global $rtTPG;
|
166 |
|
167 |
+
return array(
|
168 |
+
'layout' => array(
|
169 |
+
"type" => "select",
|
170 |
+
"name" => "layout",
|
171 |
+
"label" => "Layout",
|
172 |
+
"id" => "rt-tpg-sc-layout",
|
173 |
+
"class" => "rt-select2",
|
174 |
+
"options" => $this->rtTPGLayouts()
|
175 |
+
),
|
176 |
+
'isotope-filtering' => array(
|
177 |
+
"type" => "select",
|
178 |
+
"name" => "isotope_filter",
|
179 |
+
"label" => "Isotope Filter",
|
180 |
+
'holderClass' => "sc-isotope-filter tpg-hidden",
|
181 |
+
"id" => "rt-tpg-sc-isotope-filter",
|
182 |
+
"class" => "rt-select2",
|
183 |
+
"options" => $rtTPG->rt_get_taxonomy_for_isotope_filter()
|
184 |
+
),
|
185 |
+
'tpg_show_all_text' => array(
|
186 |
+
"type" => "text",
|
187 |
+
"name" => "tpg_show_all_text",
|
188 |
+
'holderClass' => "sc-isotope-filter tpg-hidden",
|
189 |
+
"label" => esc_html__( "Show all text", 'the-post-grid' ),
|
190 |
+
"default" => esc_html__( "Show all", 'the-post-grid' )
|
191 |
+
),
|
192 |
+
'tgp_layout2_image_column' => array(
|
193 |
+
'type' => 'select',
|
194 |
+
"name" => "tgp_layout2_image_column",
|
195 |
+
"id" => "tgp_layout2_image_column",
|
196 |
+
'label' => __( 'Image column', 'the-post-grid' ),
|
197 |
+
'class' => 'rt-select2',
|
198 |
+
'holderClass' => "holder-layout2-image-column tpg-hidden",
|
199 |
+
'default' => 4,
|
200 |
+
'options' => $this->rtTPGColumns(),
|
201 |
+
"description" => "Content column will calculate automatically"
|
202 |
+
),
|
203 |
+
'column' => array(
|
204 |
+
"type" => "select",
|
205 |
+
"name" => "column",
|
206 |
+
"label" => "Column",
|
207 |
+
"id" => "rt-column",
|
208 |
+
"class" => "rt-select2",
|
209 |
+
"default" => 4,
|
210 |
+
"options" => $this->rtTPGColumns()
|
211 |
+
),
|
212 |
+
'pagination' => array(
|
213 |
+
"type" => "checkbox",
|
214 |
+
"name" => "pagination",
|
215 |
+
"label" => "Pagination",
|
216 |
+
'holderClass' => "pagination",
|
217 |
+
"id" => "rt-tpg-pagination",
|
218 |
+
"option" => 'Enable'
|
219 |
+
),
|
220 |
+
'posts_per_page' => array(
|
221 |
+
"type" => "number",
|
222 |
+
"name" => "posts_per_page",
|
223 |
+
"label" => "Display per page",
|
224 |
+
'holderClass' => "posts-per-page tpg-hidden",
|
225 |
+
"id" => "posts-per-page",
|
226 |
+
"default" => 5,
|
227 |
+
"description" => __( "If value of Limit setting is not blank (empty), this value should be smaller than Limit value.",
|
228 |
+
'the-post-grid' )
|
229 |
+
),
|
230 |
+
'featured_image' => array(
|
231 |
+
"type" => "checkbox",
|
232 |
+
"name" => "featured_image",
|
233 |
+
"label" => "Feature Image",
|
234 |
+
"id" => "rt-feature-image",
|
235 |
+
"option" => 'Disable'
|
236 |
+
),
|
237 |
+
'featured_image_size' => array(
|
238 |
+
"type" => "select",
|
239 |
+
"name" => "featured_image_size",
|
240 |
+
"label" => "Feature Image Size",
|
241 |
+
"id" => "featured-image-size",
|
242 |
+
'holderClass' => "feature-image-options tpg-hidden",
|
243 |
+
"class" => "rt-select2",
|
244 |
+
"options" => $rtTPG->get_image_sizes()
|
245 |
+
),
|
246 |
+
'media_source' => array(
|
247 |
+
"type" => "radio",
|
248 |
+
"name" => "media_source",
|
249 |
+
"label" => "Media Source",
|
250 |
+
"id" => "media-source",
|
251 |
+
'holderClass' => "feature-image-options tpg-hidden",
|
252 |
+
"default" => 'feature_image',
|
253 |
+
"alignment" => "vertical",
|
254 |
+
"options" => $this->rtMediaSource()
|
255 |
+
),
|
256 |
+
'tpg_title_limit' => array(
|
257 |
+
"name" => "tpg_title_limit",
|
258 |
+
"id" => "tpg-title-limit",
|
259 |
+
"type" => "number",
|
260 |
+
"label" => esc_html__( "Title limit", 'the-post-grid' ),
|
261 |
+
"description" => esc_html__( "Title limit only integer number is allowed, Leave it blank for full title.", 'the-post-grid' )
|
262 |
+
),
|
263 |
+
'tpg_title_limit_type' => array(
|
264 |
+
"name" => "tpg_title_limit_type",
|
265 |
+
"id" => "tpg-title-limit-type",
|
266 |
+
"type" => "radio",
|
267 |
+
"label" => esc_html__( "Title limit type", 'the-post-grid' ),
|
268 |
+
"alignment" => "vertical",
|
269 |
+
"default" => 'character',
|
270 |
+
"options" => $this->get_limit_type(),
|
271 |
+
),
|
272 |
+
'excerpt_limit' => array(
|
273 |
+
"type" => "number",
|
274 |
+
"name" => "excerpt_limit",
|
275 |
+
"label" => esc_html__( "Excerpt limit", 'the-post-grid' ),
|
276 |
+
"id" => "excerpt-limit",
|
277 |
+
"description" => __( "Excerpt limit only integer number is allowed, Leave it blank for full excerpt. Note: This will remove all html tag",
|
278 |
+
'the-post-grid' )
|
279 |
+
),
|
280 |
+
'tgp_excerpt_type' => array(
|
281 |
+
"type" => "radio",
|
282 |
+
"label" => esc_html__( "Excerpt Type", 'the-post-grid' ),
|
283 |
+
"name" => "tgp_excerpt_type",
|
284 |
+
"id" => "tgp_excerpt_type",
|
285 |
+
"alignment" => "vertical",
|
286 |
+
"default" => 'character',
|
287 |
+
"options" => $this->get_limit_type( 'content' ),
|
288 |
+
),
|
289 |
+
'tgp_excerpt_more_text' => array(
|
290 |
+
"type" => "text",
|
291 |
+
"label" => esc_html__( "Excerpt more text", 'the-post-grid' ),
|
292 |
+
"name" => "tgp_excerpt_more_text",
|
293 |
+
"id" => "tgp_excerpt_more_text",
|
294 |
+
"default" => "..."
|
295 |
+
),
|
296 |
+
'tgp_read_more_text' => array(
|
297 |
+
"type" => "text",
|
298 |
+
"label" => esc_html__( "Read more text", 'the-post-grid' ),
|
299 |
+
"name" => "tgp_read_more_text",
|
300 |
+
"id" => "tgp_read_more_text",
|
301 |
+
),
|
302 |
+
'tpg_overlay' => array(
|
303 |
+
"type" => "checkbox",
|
304 |
+
"name" => "tpg_overlay",
|
305 |
+
"label" => esc_html__( "Overlay", 'the-post-grid' ),
|
306 |
+
"id" => "tpg_overlay",
|
307 |
+
"option" => 'Enable'
|
308 |
+
),
|
309 |
+
'title_tag' => array(
|
310 |
+
'type' => 'select',
|
311 |
+
'name' => 'title_tag',
|
312 |
+
'label' => esc_html__( 'Title tag', 'the-post-grid' ),
|
313 |
+
'class' => 'rt-select2',
|
314 |
+
'id' => 'title-tag',
|
315 |
+
'options' => $this->getTitleTags(),
|
316 |
+
'default' => 'h2'
|
317 |
+
),
|
318 |
+
);
|
319 |
+
}
|
320 |
|
321 |
+
function get_limit_type( $content = null ) {
|
322 |
+
$types = array(
|
323 |
+
'character' => __( "Character", "the-post-grid" ),
|
324 |
+
'word' => __( "Word", "the-post-grid" )
|
325 |
+
);
|
326 |
+
if ( $content === 'content' ) {
|
327 |
+
$types['full'] = __( "Full Content", "the-post-grid" );
|
328 |
+
}
|
329 |
|
330 |
+
return apply_filters( 'tpg_limit_type', $types, $content );
|
331 |
+
}
|
332 |
|
333 |
+
function rtTPGStyleFields() {
|
334 |
|
335 |
+
return array(
|
336 |
+
'parent_class' => array(
|
337 |
+
"name" => "parent_class",
|
338 |
+
"type" => "text",
|
339 |
+
"label" => "Parent class",
|
340 |
+
"class" => "medium-text",
|
341 |
+
"description" => "Parent class for adding custom css"
|
342 |
+
),
|
343 |
+
'primary_color' => array(
|
344 |
+
"type" => "text",
|
345 |
+
"name" => "primary_color",
|
346 |
+
"label" => "Primary Color",
|
347 |
+
"id" => "primary-color",
|
348 |
+
"class" => "rt-color",
|
349 |
+
"default" => "#0367bf"
|
350 |
+
),
|
351 |
+
'button_bg_color' => array(
|
352 |
+
"type" => "text",
|
353 |
+
"name" => "button_bg_color",
|
354 |
+
"label" => "Button background color",
|
355 |
+
"id" => "button-bg-color",
|
356 |
+
"class" => "rt-color"
|
357 |
+
),
|
358 |
+
'button_hover_bg_color' => array(
|
359 |
+
"type" => "text",
|
360 |
+
"name" => "button_hover_bg_color",
|
361 |
+
"label" => "Button hover background color",
|
362 |
+
"id" => "button-hover-bg-color",
|
363 |
+
"class" => "rt-color"
|
364 |
+
),
|
365 |
+
'button_active_bg_color' => array(
|
366 |
+
"type" => "text",
|
367 |
+
"name" => "button_active_bg_color",
|
368 |
+
"label" => "Button active background color",
|
369 |
+
"id" => "button-active-bg-color",
|
370 |
+
"class" => "rt-color"
|
371 |
+
),
|
372 |
+
'button_text_bg_color' => array(
|
373 |
+
"type" => "text",
|
374 |
+
"name" => "button_text_color",
|
375 |
+
"label" => "Button text color",
|
376 |
+
"id" => "button-text-color",
|
377 |
+
"class" => "rt-color"
|
378 |
+
),
|
379 |
+
'title_color' => array(
|
380 |
+
"type" => "text",
|
381 |
+
"name" => "title_color",
|
382 |
+
"label" => esc_html__( "Title color", "the-post-grid" ),
|
383 |
+
"id" => "title_color",
|
384 |
+
"class" => "rt-color"
|
385 |
+
),
|
386 |
+
'title_hover_color' => array(
|
387 |
+
"type" => "text",
|
388 |
+
"name" => "title_hover_color",
|
389 |
+
"label" => esc_html__( "Title hover color", "the-post-grid" ),
|
390 |
+
"id" => "title_hover_color",
|
391 |
+
"class" => "rt-color"
|
392 |
+
),
|
393 |
+
'tpg_read_more_button_border_radius' => array(
|
394 |
+
"type" => "number",
|
395 |
+
"name" => "tpg_read_more_button_border_radius",
|
396 |
+
"id" => "tpg-read-more-button-border-radius",
|
397 |
+
"class" => "small-text",
|
398 |
+
"label" => esc_html__( "Read more button border radius", "the-post-grid" ),
|
399 |
+
"description" => esc_html__( "Leave it blank for default", 'the-post-grid' )
|
400 |
+
)
|
401 |
+
);
|
402 |
|
403 |
+
}
|
404 |
|
405 |
+
function getTitleTags() {
|
406 |
+
return array(
|
407 |
+
'h2' => "H2",
|
408 |
+
'h3' => "H3",
|
409 |
+
'h4' => "H4"
|
410 |
+
);
|
411 |
+
}
|
412 |
|
413 |
+
function itemFields() {
|
414 |
+
return array(
|
415 |
+
"type" => "checkbox",
|
416 |
+
"name" => "item_fields",
|
417 |
+
"label" => "Field selection",
|
418 |
+
"id" => "item-fields",
|
419 |
+
"multiple" => true,
|
420 |
+
"alignment" => "vertical",
|
421 |
+
"default" => array_keys( $this->rtTPGItemFields() ),
|
422 |
+
"options" => $this->rtTPGItemFields()
|
423 |
+
);
|
424 |
+
}
|
425 |
|
426 |
+
function rtMediaSource() {
|
427 |
+
return array(
|
428 |
+
"feature_image" => __( "Feature Image", 'the-post-grid' ),
|
429 |
+
"first_image" => __( "First Image from content", 'the-post-grid' )
|
430 |
+
);
|
431 |
+
}
|
432 |
|
433 |
+
function rtTPGColumns() {
|
434 |
+
return array(
|
435 |
+
1 => "Column 1",
|
436 |
+
2 => "Column 2",
|
437 |
+
3 => "Column 3",
|
438 |
+
4 => "Column 4",
|
439 |
+
5 => "Column 5",
|
440 |
+
6 => "Column 6"
|
441 |
+
);
|
442 |
+
}
|
443 |
|
444 |
+
function rtTPGLayouts() {
|
445 |
+
$layouts = array(
|
446 |
+
'layout1' => "Layout 1",
|
447 |
+
'layout2' => "Layout 2",
|
448 |
+
'layout3' => "Layout 3",
|
449 |
+
'isotope1' => "Isotope Layout"
|
450 |
+
);
|
451 |
|
452 |
+
return apply_filters( 'tpg_layouts', $layouts );
|
453 |
+
}
|
454 |
|
455 |
+
function rtTPGItemFields() {
|
456 |
+
return array(
|
457 |
+
'title' => __( "Title", 'the-post-grid' ),
|
458 |
+
'excerpt' => __( "Excerpt", 'the-post-grid' ),
|
459 |
+
'read_more' => __( "Read More", 'the-post-grid' ),
|
460 |
+
'post_date' => __( "Post Date", 'the-post-grid' ),
|
461 |
+
'author' => __( "Author", 'the-post-grid' ),
|
462 |
+
'categories' => __( "Categories", 'the-post-grid' ),
|
463 |
+
'tags' => __( "Tags", 'the-post-grid' ),
|
464 |
+
'comment_count' => __( "Comment Count", 'the-post-grid' )
|
465 |
+
);
|
466 |
+
}
|
467 |
|
468 |
+
}
|
469 |
|
470 |
endif;
|
lib/classes/rtTPGShortCode.php
CHANGED
@@ -1,476 +1,481 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (!class_exists('rtTPGShortCode')):
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
|
|
|
|
|
|
|
|
284 |
<button data-filter="*" class="selected">' . $arg['show_all_text'] . '</button>';
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
|
|
414 |
#{$layout} .rt-detail .post-meta-user a,
|
415 |
#{$layout} .rt-detail .post-meta-category a{";
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
#{$layout} .rt-tpg-isotope-buttons button,
|
425 |
#{$layout} .rt-detail .read-more a{";
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
#{$layout} .rt-tpg-isotope-buttons button:hover,
|
432 |
#{$layout} .rt-detail .read-more a:hover{";
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
#{$layout} .rt-tpg-isotope-buttons button.selected{";
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
#{$layout} .rt-tpg-isotope-buttons button,
|
445 |
#{$layout} .rt-detail .read-more a{";
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
#{$layout} .rt-detail h3.entry-title a,
|
452 |
#{$layout} .rt-detail h4.entry-title a{";
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
#{$layout} .rt-detail h3.entry-title a:hover,
|
459 |
#{$layout} .rt-detail h4.entry-title a:hover{";
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
endif;
|
1 |
<?php
|
2 |
|
3 |
+
if ( ! class_exists( 'rtTPGShortCode' ) ):
|
4 |
+
|
5 |
+
class rtTPGShortCode {
|
6 |
+
|
7 |
+
private $scA = array();
|
8 |
+
|
9 |
+
function __construct() {
|
10 |
+
add_shortcode( 'the-post-grid', array( $this, 'the_post_grid_short_code' ) );
|
11 |
+
add_action( 'wp_ajax_tpgPreviewAjaxCall', array( $this, 'the_post_grid_short_code' ) );
|
12 |
+
}
|
13 |
+
|
14 |
+
function register_sc_scripts() {
|
15 |
+
$iso = false;
|
16 |
+
foreach ( $this->scA as $sc ) {
|
17 |
+
if ( isset( $sc ) && is_array( $sc ) ) {
|
18 |
+
if ( $sc['isIsotope'] ) {
|
19 |
+
$iso = true;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
}
|
23 |
+
if ( count( $this->scA ) ) {
|
24 |
+
if ( $iso ) {
|
25 |
+
wp_enqueue_script( 'rt-isotope-js' );
|
26 |
+
}
|
27 |
+
wp_enqueue_style( 'rt-fontawsome' );
|
28 |
+
wp_enqueue_script( 'rt-actual-height-js' );
|
29 |
+
wp_enqueue_script( 'rt-tpg' );
|
30 |
+
$nonce = wp_create_nonce( rtTPG()->nonceText() );
|
31 |
+
wp_localize_script( 'rt-tpg', 'rttpg',
|
32 |
+
array(
|
33 |
+
'nonceID' => rtTPG()->nonceId(),
|
34 |
+
'nonce' => $nonce,
|
35 |
+
'ajaxurl' => admin_url( 'admin-ajax.php' )
|
36 |
+
) );
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
function the_post_grid_short_code( $atts = array(), $content = null ) {
|
41 |
+
$error = true;
|
42 |
+
$html = $msg = null;
|
43 |
+
$preview = isset( $_REQUEST['sc_id'] ) ? absint( $_REQUEST['sc_id'] ) : 0;
|
44 |
+
$arg = array();
|
45 |
+
$atts = shortcode_atts( array(
|
46 |
+
'id' => null
|
47 |
+
), $atts, 'the-post-grid' );
|
48 |
+
$scID = $atts['id'];
|
49 |
+
if ( ( ! $preview && $scID && ! is_null( get_post( $scID ) ) ) || ( $preview && rtTPG()->verifyNonce() ) ) {
|
50 |
+
$rand = mt_rand();
|
51 |
+
$layoutID = "rt-tpg-container-" . $rand;
|
52 |
+
$pagination = false;
|
53 |
+
|
54 |
+
if ( $preview ) {
|
55 |
+
$error = false;
|
56 |
+
$scMeta = $_REQUEST;
|
57 |
+
$layout = isset( $scMeta['layout'] ) ? $scMeta['layout'] : 'layout1';
|
58 |
+
$col = isset( $scMeta['column'] ) ? intval( $scMeta['column'] ) : 4;
|
59 |
+
|
60 |
+
$fImg = isset( $scMeta['featured_image'] ) ? true : false;
|
61 |
+
$fImgSize = isset( $scMeta['featured_image_size'] ) ? $scMeta['featured_image_size'] : "medium";
|
62 |
+
$mediaSource = isset( $scMeta['media_source'] ) ? $scMeta['media_source'] : "feature_image";
|
63 |
+
$arg['excerpt_type'] = isset( $scMeta['tgp_excerpt_type'] ) ? $scMeta['tgp_excerpt_type'] : 'character';
|
64 |
+
$arg['excerpt_limit'] = isset( $scMeta['excerpt_limit'] ) ? absint( $scMeta['excerpt_limit'] ) : 0;
|
65 |
+
$arg['excerpt_more_text'] = isset( $scMeta['tgp_excerpt_more_text'] ) ? $scMeta['tgp_excerpt_more_text'] : null;
|
66 |
+
$arg['title_limit_type'] = isset( $scMeta['tpg_title_limit_type'] ) ? $scMeta['tpg_title_limit_type'] : 'character';
|
67 |
+
$arg['title_limit'] = isset( $scMeta['tpg_title_limit'] ) ? absint( $scMeta['tpg_title_limit'] ) : 0;
|
68 |
+
$arg['read_more_text'] = isset( $scMeta['tgp_read_more_text'] ) && ! empty( $scMeta['tgp_read_more_text'] ) ? $scMeta['tgp_read_more_text'] : __( 'Read More',
|
69 |
+
'the-post-grid' );
|
70 |
+
$arg['show_all_text'] = isset( $scMeta['tpg_show_all_text'] ) && ! empty( $scMeta['tpg_show_all_text'] ) ? $scMeta['tpg_show_all_text'] : __( 'Show all',
|
71 |
+
'the-post-grid-pro' );
|
72 |
+
$postType = isset( $scMeta['tpg_post_type'] ) ? $scMeta['tpg_post_type'] : null;
|
73 |
+
$post__in = isset( $scMeta['post__in'] ) ? $scMeta['post__in'] : null;
|
74 |
+
$post__not_in = isset( $scMeta['post__not_in'] ) ? $scMeta['post__not_in'] : null;
|
75 |
+
$limit = isset( $scMeta['limit'] ) && ! empty( $scMeta['limit'] ) ? ( $scMeta['limit'] == - 1 ? 10000000 : (int) $scMeta['limit'] ) : 10000000;
|
76 |
+
$pagination = isset( $scMeta['pagination'] ) ? $scMeta['pagination'] : false;
|
77 |
+
$posts_per_page = isset( $scMeta['posts_per_page'] ) ? intval( $scMeta['posts_per_page'] ) : $limit;
|
78 |
+
$order_by = isset( $scMeta['order_by'] ) ? $scMeta['order_by'] : null;
|
79 |
+
$order = isset( $scMeta['order'] ) ? $scMeta['order'] : null;
|
80 |
+
$s = isset( $scMeta['s'] ) ? $scMeta['s'] : null;
|
81 |
+
$isotope_filter = isset( $scMeta['isotope_filter'] ) ? $scMeta['isotope_filter'] : null;
|
82 |
+
|
83 |
+
} else {
|
84 |
+
$scMeta = get_post_meta( $scID );
|
85 |
+
$scMeta['sc_id'] = $scID;
|
86 |
+
$layout = isset( $scMeta['layout'][0] ) ? $scMeta['layout'][0] : 'layout1';
|
87 |
+
$col = isset( $scMeta['column'][0] ) ? intval( $scMeta['column'][0] ) : 4;
|
88 |
+
|
89 |
+
$fImg = isset( $scMeta['featured_image'][0] ) ? true : false;
|
90 |
+
$fImgSize = isset( $scMeta['featured_image_size'][0] ) ? $scMeta['featured_image_size'][0] : "medium";
|
91 |
+
$mediaSource = isset( $scMeta['media_source'][0] ) ? $scMeta['media_source'][0] : "feature_image";
|
92 |
+
$arg['excerpt_type'] = isset( $scMeta['tgp_excerpt_type'][0] ) ? $scMeta['tgp_excerpt_type'][0] : 'character';
|
93 |
+
$arg['excerpt_limit'] = isset( $scMeta['excerpt_limit'][0] ) ? absint( $scMeta['excerpt_limit'][0] ) : 0;
|
94 |
+
$arg['excerpt_more_text'] = isset( $scMeta['tgp_excerpt_more_text'][0] ) ? $scMeta['tgp_excerpt_more_text'][0] : null;
|
95 |
+
$arg['title_limit_type'] = isset( $scMeta['tpg_title_limit_type'][0] ) ? $scMeta['tpg_title_limit_type'][0] : 'character';
|
96 |
+
$arg['title_limit'] = isset( $scMeta['tpg_title_limit'][0] ) ? absint( $scMeta['tpg_title_limit'][0] ) : 0;
|
97 |
+
$arg['read_more_text'] = isset( $scMeta['tgp_read_more_text'][0] ) && ! empty( $scMeta['tgp_read_more_text'][0] ) ? $scMeta['tgp_read_more_text'][0] : __( 'Read More',
|
98 |
+
'the-post-grid' );
|
99 |
+
$arg['show_all_text'] = ( ! empty( $scMeta['tpg_show_all_text'][0] ) ? $scMeta['tpg_show_all_text'][0] : __( 'Show all',
|
100 |
+
'the-post-grid-pro' ) );
|
101 |
+
|
102 |
+
$postType = isset( $scMeta['tpg_post_type'][0] ) ? $scMeta['tpg_post_type'][0] : null;
|
103 |
+
$post__in = isset( $scMeta['post__in'][0] ) ? $scMeta['post__in'][0] : null;
|
104 |
+
$post__not_in = isset( $scMeta['post__not_in'][0] ) ? $scMeta['post__not_in'][0] : null;
|
105 |
+
$limit = isset( $scMeta['limit'][0] ) && ! empty( $scMeta['limit'][0] ) ? ( $scMeta['limit'][0] == - 1 ? 10000000 : (int) $scMeta['limit'][0] ) : 10000000;
|
106 |
+
$pagination = isset( $scMeta['pagination'][0] ) ? $scMeta['pagination'][0] : false;
|
107 |
+
$posts_per_page = isset( $scMeta['posts_per_page'][0] ) ? intval( $scMeta['posts_per_page'][0] ) : $limit;
|
108 |
+
$order_by = isset( $scMeta['order_by'][0] ) ? $scMeta['order_by'][0] : null;
|
109 |
+
$order = isset( $scMeta['order'][0] ) ? $scMeta['order'][0] : null;
|
110 |
+
$s = isset( $scMeta['s'][0] ) ? $scMeta['s'][0] : null;
|
111 |
+
$isotope_filter = isset( $scMeta['isotope_filter'][0] ) ? $scMeta['isotope_filter'][0] : null;
|
112 |
+
|
113 |
+
}
|
114 |
+
if ( ! in_array( $layout, array_keys( rtTPG()->rtTPGLayouts() ) ) ) {
|
115 |
+
$layout = 'layout1';
|
116 |
+
}
|
117 |
+
if ( ! in_array( $col, array_keys( rtTPG()->rtTPGColumns() ) ) ) {
|
118 |
+
$col = 4;
|
119 |
+
}
|
120 |
+
|
121 |
+
$isIsotope = preg_match( '/isotope/', $layout );
|
122 |
+
|
123 |
+
/* Argument create */
|
124 |
+
$args = array();
|
125 |
+
$itemIdsArgs = array();
|
126 |
+
if ( $postType ) {
|
127 |
+
$args['post_type'] = $itemIdsArgs['post_type'] = $postType;
|
128 |
+
}
|
129 |
+
|
130 |
+
// Common filter
|
131 |
+
/* post__in */
|
132 |
+
if ( $post__in ) {
|
133 |
+
$post__in = explode( ',', $post__in );
|
134 |
+
$args['post__in'] = $itemIdsArgs['post__in'] = $post__in;
|
135 |
+
}
|
136 |
+
/* post__not_in */
|
137 |
+
if ( $post__not_in ) {
|
138 |
+
$post__not_in = explode( ',', $post__not_in );
|
139 |
+
$args['post__not_in'] = $itemIdsArgs['post__not_in'] = $post__not_in;
|
140 |
+
}
|
141 |
+
|
142 |
+
/* LIMIT */
|
143 |
+
$args['posts_per_page'] = $itemIdsArgs['posts_per_page'] = $limit;
|
144 |
+
if ( ! $isIsotope && $pagination ) {
|
145 |
+
if ( $posts_per_page > $limit ) {
|
146 |
+
$posts_per_page = $limit;
|
147 |
+
}
|
148 |
+
// Set 'posts_per_page' parameter
|
149 |
+
$args['posts_per_page'] = $posts_per_page;
|
150 |
+
if ( get_query_var( 'paged' ) ) {
|
151 |
+
$paged = get_query_var( 'paged' );
|
152 |
+
} elseif ( get_query_var( 'page' ) ) {
|
153 |
+
$paged = get_query_var( 'page' );
|
154 |
+
} else {
|
155 |
+
$paged = 1;
|
156 |
+
}
|
157 |
+
$offset = $posts_per_page * ( (int) $paged - 1 );
|
158 |
+
$args['paged'] = $paged;
|
159 |
+
|
160 |
+
// Update posts_per_page
|
161 |
+
if ( intval( $args['posts_per_page'] ) > $limit - $offset ) {
|
162 |
+
$args['posts_per_page'] = $limit - $offset;
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
}
|
167 |
+
|
168 |
+
// Advance Filter
|
169 |
+
$adv_filter = isset( $scMeta['post_filter'] ) ? $scMeta['post_filter'] : array();
|
170 |
+
|
171 |
+
// Taxonomy
|
172 |
+
$taxQ = array();
|
173 |
+
if ( in_array( 'tpg_taxonomy', $adv_filter ) && isset( $scMeta['tpg_taxonomy'] ) ) {
|
174 |
+
|
175 |
+
if ( is_array( $scMeta['tpg_taxonomy'] ) && ! empty( $scMeta['tpg_taxonomy'] ) ) {
|
176 |
+
foreach ( $scMeta['tpg_taxonomy'] as $taxonomy ) {
|
177 |
+
$terms = ( isset( $scMeta[ 'term_' . $taxonomy ] ) ? $scMeta[ 'term_' . $taxonomy ] : array() );
|
178 |
+
if ( is_array( $terms ) && ! empty( $terms ) ) {
|
179 |
+
$operator = isset( $scMeta[ 'term_operator_' . $taxonomy ][0] ) ? $scMeta[ 'term_operator_' . $taxonomy ][0] : "IN";
|
180 |
+
if ( $preview ) {
|
181 |
+
$operator = isset( $scMeta[ 'term_operator_' . $taxonomy ] ) ? $scMeta[ 'term_operator_' . $taxonomy ] : "IN";
|
182 |
+
}
|
183 |
+
$taxQ[] = array(
|
184 |
+
'taxonomy' => $taxonomy,
|
185 |
+
'field' => 'term_id',
|
186 |
+
'terms' => $terms,
|
187 |
+
'operator' => $operator,
|
188 |
+
);
|
189 |
+
}
|
190 |
+
}
|
191 |
+
}
|
192 |
+
if ( count( $taxQ ) >= 2 ) {
|
193 |
+
$relation = isset( $scMeta['taxonomy_relation'][0] ) ? $scMeta['taxonomy_relation'][0] : "AND";
|
194 |
+
if ( $preview ) {
|
195 |
+
$relation = isset( $scMeta['taxonomy_relation'] ) ? $scMeta['taxonomy_relation'] : "AND";
|
196 |
+
}
|
197 |
+
$taxQ['relation'] = $relation;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
if ( ! empty( $taxQ ) ) {
|
202 |
+
$args['tax_query'] = $itemIdsArgs['tax_query'] = $taxQ;
|
203 |
+
}
|
204 |
+
|
205 |
+
// Order
|
206 |
+
if ( in_array( 'order', $adv_filter ) ) {
|
207 |
+
if ( $order ) {
|
208 |
+
$args['order'] = $itemIdsArgs['order'] = $order;
|
209 |
+
}
|
210 |
+
if ( $order_by ) {
|
211 |
+
$args['orderby'] = $itemIdsArgs['orderby'] = $order_by;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
// Status
|
215 |
+
if ( in_array( 'tpg_post_status', $adv_filter ) ) {
|
216 |
+
$post_status = ( isset( $scMeta['tpg_post_status'] ) ? $scMeta['tpg_post_status'] : array() );
|
217 |
+
if ( ! empty( $post_status ) ) {
|
218 |
+
$args['post_status'] = $itemIdsArgs['post_status'] = $post_status;
|
219 |
+
} else {
|
220 |
+
$args['post_status'] = $itemIdsArgs['post_status'] = 'publish';
|
221 |
+
}
|
222 |
+
}
|
223 |
+
// Author
|
224 |
+
$author = ( isset( $scMeta['author'] ) ? $scMeta['author'] : array() );
|
225 |
+
if ( in_array( 'author', $adv_filter ) && ! empty( $author ) ) {
|
226 |
+
$args['author__in'] = $itemIdsArgs['author__in'] = $author;
|
227 |
+
}
|
228 |
+
// Search
|
229 |
+
if ( in_array( 's', $adv_filter ) && $s ) {
|
230 |
+
$args['s'] = $itemIdsArgs['s'] = $s;
|
231 |
+
}
|
232 |
+
|
233 |
+
// Validation
|
234 |
+
|
235 |
+
if ( ( $layout == 'layout2' ) || ( $layout == 'layout3' ) ) {
|
236 |
+
$iCol = isset( $scMeta['tgp_layout2_image_column'][0] ) ? absint( $scMeta['tgp_layout2_image_column'][0] ) : 4;
|
237 |
+
if ( $preview ) {
|
238 |
+
$iCol = isset( $scMeta['tgp_layout2_image_column'] ) ? absint( $scMeta['tgp_layout2_image_column'] ) : 4;
|
239 |
+
}
|
240 |
+
$iCol = $iCol > 12 ? 4 : $iCol;
|
241 |
+
$cCol = 12 - $iCol;
|
242 |
+
$arg['image_area'] = "rt-col-sm-{$iCol} rt-col-xs-12 ";
|
243 |
+
$arg['content_area'] = "rt-col-sm-{$cCol} rt-col-xs-12 ";
|
244 |
+
}
|
245 |
+
$col = $col == 5 ? "24" : round( 12 / $col );
|
246 |
+
if ( ( $layout == 'layout2' ) || ( $layout == 'layout3' ) ) {
|
247 |
+
$arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-12 rt-col-xs-12";
|
248 |
+
} else {
|
249 |
+
$arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-6 rt-col-xs-12";
|
250 |
+
}
|
251 |
+
|
252 |
+
|
253 |
+
$arg['class'] = 'rt-equal-height';
|
254 |
+
if ( $isIsotope ) {
|
255 |
+
$arg['class'] .= ' isotope-item';
|
256 |
+
}
|
257 |
+
|
258 |
+
$arg['overlay'] = empty( $scMeta['tpg_overlay'][0] ) ? false : true;
|
259 |
+
$parentClass = ( ! empty( $scMeta['parent_class'][0] ) ? trim( $scMeta['parent_class'][0] ) : null );
|
260 |
+
$arg['items'] = isset( $scMeta['item_fields'] ) ? ( $scMeta['item_fields'] ? $scMeta['item_fields'] : array() ) : array();
|
261 |
+
$arg['title_tag'] = ( ! empty( $scMeta['title_tag'][0] ) && in_array( $scMeta['title_tag'][0], array_keys( rtTPG()->getTitleTags() ) ) ) ? esc_attr( $scMeta['title_tag'][0] ) : 'h2';
|
262 |
+
$postQuery = new WP_Query( apply_filters( 'tpg_sc_query_args', $args, $scMeta ) );
|
263 |
+
// Start layout
|
264 |
+
$html .= "<div class='container-fluid rt-tpg-container rt-tpg-container-{$scMeta['sc_id']} {$parentClass}' data-sc-id='{$scMeta['sc_id']}' id='{$layoutID}'>";
|
265 |
+
$extClass = null;
|
266 |
+
if ( $isIsotope ) {
|
267 |
+
$extClass = ' tpg-isotope';
|
268 |
+
}
|
269 |
+
// Set readmore false if excerpt type = full content
|
270 |
+
if ( isset( $arg['excerpt_type'] ) && $arg['excerpt_type'] === 'full' && ($key = array_search('read_more', $arg['items'])) !== false ) {
|
271 |
+
unset( $arg['items'][$key] );
|
272 |
+
}
|
273 |
+
|
274 |
+
$html .= "<div class='rt-row rt-content-loader {$layout}{$extClass}'>";
|
275 |
+
if ( $postQuery->have_posts() ) {
|
276 |
+
$html .= $this->layoutStyle( $layoutID, $scMeta, $preview );
|
277 |
+
|
278 |
+
if ( $isIsotope ) {
|
279 |
+
$selectedTerms = ( isset( $scMeta[ 'term_' . $isotope_filter ] ) ? $scMeta[ 'term_' . $isotope_filter ] : array() );
|
280 |
+
$terms = get_terms( $isotope_filter, array(
|
281 |
+
'orderby' => 'name',
|
282 |
+
'order' => 'ASC',
|
283 |
+
'hide_empty' => false,
|
284 |
+
'include' => $selectedTerms
|
285 |
+
) );
|
286 |
+
|
287 |
+
$html .= '<div id="iso-button-' . $rand . '" class="iso-button-' . $scMeta['sc_id'] . ' rt-tpg-isotope-buttons filter-button-group option-set">
|
288 |
<button data-filter="*" class="selected">' . $arg['show_all_text'] . '</button>';
|
289 |
+
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
|
290 |
+
foreach ( $terms as $term ) {
|
291 |
+
$html .= "<button data-filter='.iso_{$term->term_id}'>" . $term->name . "</button>";
|
292 |
+
}
|
293 |
+
}
|
294 |
+
$html .= '</div>';
|
295 |
+
|
296 |
+
$html .= '<div class="rt-tpg-isotope iso-tpg-' . $scMeta['sc_id'] . '" id="iso-tpg-' . $rand . '">';
|
297 |
+
}
|
298 |
+
|
299 |
+
|
300 |
+
while ( $postQuery->have_posts() ) {
|
301 |
+
$postQuery->the_post();
|
302 |
+
$pID = get_the_ID();
|
303 |
+
$arg['pID'] = $pID;
|
304 |
+
$arg['title'] = rtTPG()->get_the_title( $pID, $arg );
|
305 |
+
$arg['pLink'] = get_permalink();
|
306 |
+
$arg['author'] = '<a href="' . get_author_posts_url( get_the_author_meta( 'ID' ) ) . '">' . get_the_author() . '</a>';
|
307 |
+
$cc = wp_count_comments( $pID );
|
308 |
+
$arg['date'] = get_the_date();
|
309 |
+
$arg['excerpt'] = rtTPG()->get_the_excerpt( $pID, $arg );
|
310 |
+
$arg['categories'] = get_the_term_list( $pID, 'category', null, ', ' );
|
311 |
+
$arg['tags'] = get_the_term_list( $pID, 'post_tag', null, ', ' );
|
312 |
+
if ( $isIsotope ) {
|
313 |
+
$termAs = wp_get_post_terms( $pID, $isotope_filter, array( "fields" => "all" ) );
|
314 |
+
$isoFilter = null;
|
315 |
+
if ( ! empty( $termAs ) ) {
|
316 |
+
foreach ( $termAs as $term ) {
|
317 |
+
$isoFilter .= " iso_" . $term->term_id;
|
318 |
+
}
|
319 |
+
}
|
320 |
+
$arg['isoFilter'] = $isoFilter;
|
321 |
+
}
|
322 |
+
$deptClass = null;
|
323 |
+
if ( ! empty( $deptAs ) ) {
|
324 |
+
foreach ( $deptAs as $dept ) {
|
325 |
+
$deptClass .= " " . $dept->slug;
|
326 |
+
}
|
327 |
+
}
|
328 |
+
if ( comments_open() ) {
|
329 |
+
$arg['comment'] = "<a href='" . get_comments_link( $pID ) . "'>{$cc->total_comments} </a>";
|
330 |
+
} else {
|
331 |
+
$arg['comment'] = "{$cc->total_comments}";
|
332 |
+
}
|
333 |
+
$imgSrc = null;
|
334 |
+
|
335 |
+
$arg['imgSrc'] = ! $fImg ? rtTPG()->getFeatureImageSrc( $pID, $fImgSize, $mediaSource ) : null;
|
336 |
+
|
337 |
+
$html .= rtTPG()->render( 'layouts/' . $layout, $arg, true );
|
338 |
+
}
|
339 |
+
|
340 |
+
if ( $isIsotope ) {
|
341 |
+
$html .= '</div>'; // End isotope item holder
|
342 |
+
}
|
343 |
+
|
344 |
+
} else {
|
345 |
+
$html .= sprintf( '<p>%s</p>',
|
346 |
+
apply_filters( 'tpg_not_found_text', __( 'No post found', 'the-post-grid' ), $args, $scMeta )
|
347 |
+
);
|
348 |
+
}
|
349 |
+
$html .= "</div>"; // End row
|
350 |
+
if ( $pagination && ! $isIsotope ) {
|
351 |
+
$found = 0;
|
352 |
+
if ( $postQuery->found_posts > $limit ) {
|
353 |
+
$found = $limit;
|
354 |
+
} else {
|
355 |
+
$found = $postQuery->found_posts;
|
356 |
+
}
|
357 |
+
$max_num_pages = ceil( $found / $posts_per_page );
|
358 |
+
$html .= rtTPG()->rt_pagination( $max_num_pages, $args['posts_per_page'] );
|
359 |
+
}
|
360 |
+
$html .= "</div>"; // container rt-tpg
|
361 |
+
|
362 |
+
wp_reset_postdata();
|
363 |
+
if ( ! $preview ) {
|
364 |
+
$scriptGenerator = array();
|
365 |
+
$scriptGenerator['layout'] = $layoutID;
|
366 |
+
$scriptGenerator['rand'] = $rand;
|
367 |
+
$scriptGenerator['scMeta'] = $scMeta;
|
368 |
+
$scriptGenerator['isIsotope'] = $isIsotope;
|
369 |
+
$this->scA[] = $scriptGenerator;
|
370 |
+
add_action( 'wp_footer', array( $this, 'register_sc_scripts' ) );
|
371 |
+
}
|
372 |
+
} else {
|
373 |
+
if ( $preview ) {
|
374 |
+
$msg = __( 'Session Error !!', 'the-post-grid' );
|
375 |
+
} else {
|
376 |
+
$html .= "<p>" . __( "No shortCode found", 'the-post-grid' ) . "</p>";
|
377 |
+
}
|
378 |
+
}
|
379 |
+
if ( $preview ) {
|
380 |
+
wp_send_json( array(
|
381 |
+
'error' => $error,
|
382 |
+
'msg' => $msg,
|
383 |
+
'data' => $html
|
384 |
+
) );
|
385 |
+
die();
|
386 |
+
}
|
387 |
+
|
388 |
+
return $html;
|
389 |
+
}
|
390 |
+
|
391 |
+
function layoutStyle( $layout, $scMeta, $preview = false ) {
|
392 |
+
if ( $preview ) {
|
393 |
+
$primaryColor = ( ! empty( $scMeta['primary_color'] ) ? $scMeta['primary_color'] : null );
|
394 |
+
$button_bg_color = ( ! empty( $scMeta['button_bg_color'] ) ? $scMeta['button_bg_color'] : null );
|
395 |
+
$button_hover_bg_color = ( ! empty( $scMeta['button_hover_bg_color'] ) ? $scMeta['button_hover_bg_color'] : null );
|
396 |
+
$button_active_bg_color = ( ! empty( $scMeta['button_active_bg_color'] ) ? $scMeta['button_active_bg_color'] : null );
|
397 |
+
$button_text_color = ( ! empty( $scMeta['button_text_color'] ) ? $scMeta['button_text_color'] : null );
|
398 |
+
$title_color = isset( $scMeta['title_color'] ) && ! empty( $scMeta['title_color'] ) ? $scMeta['title_color'] : null;
|
399 |
+
$title_hover_color = isset( $scMeta['title_hover_color'] ) && ! empty( $scMeta['title_hover_color'] ) ? $scMeta['title_hover_color'] : null;
|
400 |
+
$read_more_button_border_radius = isset( $scMeta['tpg_read_more_button_border_radius'] ) ? $scMeta['tpg_read_more_button_border_radius'] : '';
|
401 |
+
|
402 |
+
} else {
|
403 |
+
|
404 |
+
$primaryColor = ( ! empty( $scMeta['primary_color'][0] ) ? $scMeta['primary_color'][0] : null );
|
405 |
+
$button_bg_color = ( ! empty( $scMeta['button_bg_color'][0] ) ? $scMeta['button_bg_color'][0] : null );
|
406 |
+
$button_hover_bg_color = ( ! empty( $scMeta['button_hover_bg_color'][0] ) ? $scMeta['button_hover_bg_color'][0] : null );
|
407 |
+
$button_active_bg_color = ( ! empty( $scMeta['button_active_bg_color'][0] ) ? $scMeta['button_active_bg_color'][0] : null );
|
408 |
+
$button_text_color = ( ! empty( $scMeta['button_text_color'][0] ) ? $scMeta['button_text_color'][0] : null );
|
409 |
+
$title_color = isset( $scMeta['title_color'][0] ) && ! empty( $scMeta['title_color'][0] ) ? $scMeta['title_color'][0] : null;
|
410 |
+
$title_hover_color = isset( $scMeta['title_hover_color'][0] ) && ! empty( $scMeta['title_hover_color'][0] ) ? $scMeta['title_hover_color'][0] : null;
|
411 |
+
$read_more_button_border_radius = isset( $scMeta['tpg_read_more_button_border_radius'][0] ) ? $scMeta['tpg_read_more_button_border_radius'][0] : '';
|
412 |
+
|
413 |
+
}
|
414 |
+
$css = null;
|
415 |
+
$css .= "<style type='text/css' media='all'>";
|
416 |
+
// Variable
|
417 |
+
if ( $primaryColor ) {
|
418 |
+
$css .= "#{$layout} .rt-detail i,
|
419 |
#{$layout} .rt-detail .post-meta-user a,
|
420 |
#{$layout} .rt-detail .post-meta-category a{";
|
421 |
+
$css .= "color:" . $primaryColor . ";";
|
422 |
+
$css .= "}";
|
423 |
+
$css .= "body .rt-tpg-container .rt-tpg-isotope-buttons .selected{";
|
424 |
+
$css .= "background-color:" . $primaryColor . ";";
|
425 |
+
$css .= "}";
|
426 |
+
}
|
427 |
+
if ( $button_bg_color ) {
|
428 |
+
$css .= "#{$layout} .pagination li a,
|
429 |
#{$layout} .rt-tpg-isotope-buttons button,
|
430 |
#{$layout} .rt-detail .read-more a{";
|
431 |
+
$css .= "background-color:" . $button_bg_color . ";";
|
432 |
+
$css .= "}";
|
433 |
+
}
|
434 |
+
if ( $button_hover_bg_color ) {
|
435 |
+
$css .= "#{$layout} .pagination li a:hover,
|
436 |
#{$layout} .rt-tpg-isotope-buttons button:hover,
|
437 |
#{$layout} .rt-detail .read-more a:hover{";
|
438 |
+
$css .= "background-color:" . $button_hover_bg_color . ";";
|
439 |
+
$css .= "}";
|
440 |
+
}
|
441 |
+
if ( $button_active_bg_color ) {
|
442 |
+
$css .= "#{$layout} .pagination li.active span,
|
443 |
#{$layout} .rt-tpg-isotope-buttons button.selected{";
|
444 |
+
$css .= "background-color:" . $button_active_bg_color . ";";
|
445 |
+
$css .= "}";
|
446 |
+
}
|
447 |
+
if ( $button_text_color ) {
|
448 |
+
$css .= "#{$layout} .pagination li a,
|
449 |
#{$layout} .rt-tpg-isotope-buttons button,
|
450 |
#{$layout} .rt-detail .read-more a{";
|
451 |
+
$css .= "color:" . $button_text_color . ";";
|
452 |
+
$css .= "}";
|
453 |
+
}
|
454 |
+
if ( $title_color ) {
|
455 |
+
$css .= "#{$layout} .rt-detail h2.entry-title a,
|
456 |
#{$layout} .rt-detail h3.entry-title a,
|
457 |
#{$layout} .rt-detail h4.entry-title a{";
|
458 |
+
$css .= "color:" . $title_color . ";";
|
459 |
+
$css .= "}";
|
460 |
+
}
|
461 |
+
if ( $title_hover_color ) {
|
462 |
+
$css .= "#{$layout} .rt-detail h2.entry-title a:hover,
|
463 |
#{$layout} .rt-detail h3.entry-title a:hover,
|
464 |
#{$layout} .rt-detail h4.entry-title a:hover{";
|
465 |
+
$css .= "color:" . $title_hover_color . ";";
|
466 |
+
$css .= "}";
|
467 |
+
}
|
468 |
+
|
469 |
+
// Read more button Position
|
470 |
+
if ( isset( $read_more_button_border_radius ) || trim( $read_more_button_border_radius ) !== '' ) {
|
471 |
+
$css .= "#{$layout} .read-more a{";
|
472 |
+
$css .= "border-radius:" . $read_more_button_border_radius . "px;";
|
473 |
+
$css .= "}";
|
474 |
+
}
|
475 |
+
|
476 |
+
$css .= "</style>";
|
477 |
+
|
478 |
+
return $css;
|
479 |
+
}
|
480 |
+
}
|
481 |
endif;
|
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.
|
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.2
|
8 |
* Text Domain: the-post-grid
|
9 |
* Domain Path: /languages
|
10 |
* Author URI: https://radiustheme.com/
|