Version Description
- Fixed file readability issue
- Added option for script loading
- Draft post issue in preview
Download this release
Release Info
Developer | techlabpro1 |
Plugin | The Post Grid |
Version | 3.0.4 |
Comparing to | |
See all releases |
Code changes from version 3.0.3 to 3.0.4
- README.txt +7 -2
- assets/css/admin.css +63 -0
- assets/css/thepostgrid.css +18 -64
- assets/js/admin.js +17 -3
- assets/js/rttpg.js +8 -0
- languages/the-post-grid.pot +100 -72
- lib/classes/rtTPGFrontEnd.php +6 -4
- lib/classes/rtTPGHelper.php +10 -6
- lib/classes/rtTPGHook.php +10 -2
- lib/classes/rtTPGInit.php +10 -0
- lib/classes/rtTPGOptions.php +21 -0
- lib/classes/rtTPGPreview.php +3 -4
- lib/classes/rtTPGShortCode.php +1010 -997
- lib/models/rtTPGField.php +12 -0
- 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.8
|
7 |
-
Stable tag: 3.0.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -141,6 +141,11 @@ For any bug or suggestion please mail support@radiustheme.com
|
|
141 |
|
142 |
== Changelog ==
|
143 |
|
|
|
|
|
|
|
|
|
|
|
144 |
= 3.0.3 =
|
145 |
* Fixed feature image not existing notice issue
|
146 |
|
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.8.1
|
7 |
+
Stable tag: 3.0.4
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
141 |
|
142 |
== Changelog ==
|
143 |
|
144 |
+
= 3.0.4 =
|
145 |
+
* Fixed file readability issue
|
146 |
+
* Added option for script loading
|
147 |
+
* Draft post issue in preview
|
148 |
+
|
149 |
= 3.0.3 =
|
150 |
* Fixed feature image not existing notice issue
|
151 |
|
assets/css/admin.css
CHANGED
@@ -964,4 +964,67 @@ body .rt-admin-btn:hover {
|
|
964 |
float: none;
|
965 |
width: inherit;
|
966 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
967 |
}
|
964 |
float: none;
|
965 |
width: inherit;
|
966 |
}
|
967 |
+
}
|
968 |
+
|
969 |
+
/*The rttm-switch - the box around the rttm-switch-slider*/
|
970 |
+
.rttm-switch {
|
971 |
+
position: relative;
|
972 |
+
display: inline-block;
|
973 |
+
width: 50px;
|
974 |
+
height: 24px;
|
975 |
+
}
|
976 |
+
|
977 |
+
/* Hide default HTML checkbox */
|
978 |
+
.rttm-switch input {
|
979 |
+
opacity: 0;
|
980 |
+
width: 0;
|
981 |
+
height: 0;
|
982 |
+
}
|
983 |
+
|
984 |
+
/* The rttm-switch-slider */
|
985 |
+
.rttm-switch-slider {
|
986 |
+
position: absolute;
|
987 |
+
cursor: pointer;
|
988 |
+
top: 0;
|
989 |
+
left: 0;
|
990 |
+
right: 0;
|
991 |
+
bottom: 0;
|
992 |
+
background-color: #ccc;
|
993 |
+
-webkit-transition: .4s;
|
994 |
+
transition: .4s;
|
995 |
+
}
|
996 |
+
|
997 |
+
.rttm-switch-slider:before {
|
998 |
+
position: absolute;
|
999 |
+
content: "";
|
1000 |
+
height: 16px;
|
1001 |
+
width: 16px;
|
1002 |
+
left: 4px;
|
1003 |
+
bottom: 4px;
|
1004 |
+
background-color: white;
|
1005 |
+
-webkit-transition: .4s;
|
1006 |
+
transition: .4s;
|
1007 |
+
}
|
1008 |
+
|
1009 |
+
input:checked + .rttm-switch-slider {
|
1010 |
+
background-color: #5d3dfd;
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
input:focus + .rttm-switch-slider {
|
1014 |
+
box-shadow: 0 0 1px #5d3dfd;
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
input:checked + .rttm-switch-slider:before {
|
1018 |
+
-webkit-transform: translateX(26px);
|
1019 |
+
-ms-transform: translateX(26px);
|
1020 |
+
transform: translateX(26px);
|
1021 |
+
}
|
1022 |
+
|
1023 |
+
/* Rounded rttm-switch-sliders */
|
1024 |
+
.rttm-switch-slider.round {
|
1025 |
+
border-radius: 34px;
|
1026 |
+
}
|
1027 |
+
|
1028 |
+
.rttm-switch-slider.round:before {
|
1029 |
+
border-radius: 50%;
|
1030 |
}
|
assets/css/thepostgrid.css
CHANGED
@@ -678,70 +678,6 @@ span.more-loading {
|
|
678 |
margin-right: 0px;
|
679 |
}
|
680 |
|
681 |
-
/* --------------------------
|
682 |
-
Social share List View
|
683 |
-
-----------------*/
|
684 |
-
.rt-tpg-social-share {
|
685 |
-
display: inline-block;
|
686 |
-
margin: 0px 0;
|
687 |
-
float: left;
|
688 |
-
font-weight: bold;
|
689 |
-
}
|
690 |
-
|
691 |
-
.rt-tpg-social-share:after {
|
692 |
-
display: block;
|
693 |
-
clear: both;
|
694 |
-
content: '';
|
695 |
-
}
|
696 |
-
|
697 |
-
.rt-tpg-social-share a {
|
698 |
-
display: inline-block;
|
699 |
-
padding: 3px 6px;
|
700 |
-
margin-right: 0px;
|
701 |
-
outline: none;
|
702 |
-
}
|
703 |
-
|
704 |
-
.rt-tpg-social-share a i {
|
705 |
-
font-size: 16px;
|
706 |
-
outline: none;
|
707 |
-
}
|
708 |
-
|
709 |
-
.rt-tpg-social-share a.facebook i {
|
710 |
-
color: #3b5998 !important;
|
711 |
-
}
|
712 |
-
|
713 |
-
.rt-tpg-social-share a.facebook:hover i {
|
714 |
-
color: #456dc2 !important;
|
715 |
-
}
|
716 |
-
|
717 |
-
.rt-tpg-social-share a.twitter i {
|
718 |
-
color: #00aced !important;
|
719 |
-
}
|
720 |
-
|
721 |
-
.rt-tpg-social-share a.twitter:hover i {
|
722 |
-
color: #1ab8f5 !important;
|
723 |
-
}
|
724 |
-
|
725 |
-
.rt-tpg-social-share a.linkedin i {
|
726 |
-
color: #007bb6 !important;
|
727 |
-
}
|
728 |
-
|
729 |
-
.rt-tpg-social-share a.linkedin:hover i {
|
730 |
-
color: #289bd3 !important;
|
731 |
-
}
|
732 |
-
|
733 |
-
.rt-tpg-social-share a.pinterest i {
|
734 |
-
color: #cb2027 !important;
|
735 |
-
}
|
736 |
-
|
737 |
-
.rt-tpg-social-share a.reddit i {
|
738 |
-
color: rgb(255, 69, 0) !important;
|
739 |
-
}
|
740 |
-
|
741 |
-
.rt-tpg-social-share a.email i {
|
742 |
-
color: rgb(1, 102, 255) !important;
|
743 |
-
}
|
744 |
-
|
745 |
/* loader */
|
746 |
|
747 |
.rt-tpg-container .tpg-pre-loader {
|
@@ -2052,4 +1988,22 @@ body > .rt-tooltip .rt-tooltip-bottom:after {
|
|
2052 |
-o-transform: rotate(360deg);
|
2053 |
transform: rotate(360deg);
|
2054 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2055 |
}
|
678 |
margin-right: 0px;
|
679 |
}
|
680 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
/* loader */
|
682 |
|
683 |
.rt-tpg-container .tpg-pre-loader {
|
1988 |
-o-transform: rotate(360deg);
|
1989 |
transform: rotate(360deg);
|
1990 |
}
|
1991 |
+
}
|
1992 |
+
.rt-container-fluid {
|
1993 |
+
position: relative;
|
1994 |
+
}
|
1995 |
+
#bottom-script-loader {
|
1996 |
+
position: absolute;
|
1997 |
+
width: 100%;
|
1998 |
+
height: 100%;
|
1999 |
+
z-index: 99999;
|
2000 |
+
background: rgba(255,255,255,0.8);
|
2001 |
+
}
|
2002 |
+
#bottom-script-loader .rt-ball-clip-rotate {
|
2003 |
+
color: #fb4c35;
|
2004 |
+
position: absolute;
|
2005 |
+
top: 80px;
|
2006 |
+
left: 50%;
|
2007 |
+
margin-left: -16px;
|
2008 |
+
z-index: 2;
|
2009 |
}
|
assets/js/admin.js
CHANGED
@@ -132,14 +132,14 @@
|
|
132 |
$(document).ready(function () {
|
133 |
checkCustomFieldSettings();
|
134 |
rtTgpFilter();
|
|
|
|
|
|
|
135 |
tlpShowHideScMeta();
|
136 |
checkCustomField();
|
137 |
if ($('.rt-color').length) {
|
138 |
$('.rt-color').wpColorPicker();
|
139 |
}
|
140 |
-
if ($(".rt-select2").length) {
|
141 |
-
tgpLiveReloadScript();
|
142 |
-
}
|
143 |
if ($(".date-range").length) {
|
144 |
$(".date-range-start").datepicker({
|
145 |
defaultDate: "+1w",
|
@@ -204,6 +204,7 @@
|
|
204 |
|
205 |
detailLinkEffect();
|
206 |
customImageSize();
|
|
|
207 |
featureImageEffect();
|
208 |
tpgOrderByEffect();
|
209 |
$("#link_to_detail_page_holder").on("click", "input[type='radio']", function () {
|
@@ -227,6 +228,19 @@
|
|
227 |
customImageSize();
|
228 |
});
|
229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
function customImageSize() {
|
231 |
/* custom image size jquery */
|
232 |
var fImageSize = $("#featured_image_size").val();
|
132 |
$(document).ready(function () {
|
133 |
checkCustomFieldSettings();
|
134 |
rtTgpFilter();
|
135 |
+
if ($(".rt-select2").length) {
|
136 |
+
tgpLiveReloadScript();
|
137 |
+
}
|
138 |
tlpShowHideScMeta();
|
139 |
checkCustomField();
|
140 |
if ($('.rt-color').length) {
|
141 |
$('.rt-color').wpColorPicker();
|
142 |
}
|
|
|
|
|
|
|
143 |
if ($(".date-range").length) {
|
144 |
$(".date-range-start").datepicker({
|
145 |
defaultDate: "+1w",
|
204 |
|
205 |
detailLinkEffect();
|
206 |
customImageSize();
|
207 |
+
preLoaderEffect();
|
208 |
featureImageEffect();
|
209 |
tpgOrderByEffect();
|
210 |
$("#link_to_detail_page_holder").on("click", "input[type='radio']", function () {
|
228 |
customImageSize();
|
229 |
});
|
230 |
|
231 |
+
$("#tpg_load_script").on('change', function () {
|
232 |
+
preLoaderEffect();
|
233 |
+
});
|
234 |
+
|
235 |
+
function preLoaderEffect() {
|
236 |
+
var preLoader = $("#tpg_load_script_holder input[name='tpg_load_script']:checked").val();
|
237 |
+
if (preLoader) {
|
238 |
+
$("#tpg_enable_preloader_holder").show();
|
239 |
+
} else {
|
240 |
+
$("#tpg_enable_preloader_holder").hide();
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
function customImageSize() {
|
245 |
/* custom image size jquery */
|
246 |
var fImageSize = $("#featured_image_size").val();
|
assets/js/rttpg.js
CHANGED
@@ -99,10 +99,18 @@
|
|
99 |
initTpg();
|
100 |
|
101 |
$(window).on('load resize', function () {
|
|
|
102 |
HeightResize();
|
103 |
overlayIconResizeTpg();
|
104 |
});
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
function windowHashChange(isotope, IsoButton) {
|
107 |
var $hashFilter = decodeHash() || '';
|
108 |
if (!$hashFilter) {
|
99 |
initTpg();
|
100 |
|
101 |
$(window).on('load resize', function () {
|
102 |
+
tpgBottomScriptLoader();
|
103 |
HeightResize();
|
104 |
overlayIconResizeTpg();
|
105 |
});
|
106 |
|
107 |
+
function tpgBottomScriptLoader() {
|
108 |
+
$( "#bottom-script-loader" ).fadeOut(500, function() {
|
109 |
+
// fadeOut complete. Remove the loading div
|
110 |
+
$( "#bottom-script-loader" ).remove(); //makes page more lightweight
|
111 |
+
});
|
112 |
+
}
|
113 |
+
|
114 |
function windowHashChange(isotope, IsoButton) {
|
115 |
var $hashFilter = decodeHash() || '';
|
116 |
if (!$hashFilter) {
|
languages/the-post-grid.pot
CHANGED
@@ -29,7 +29,7 @@ msgstr ""
|
|
29 |
msgid "Server Error !!"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:71, ../lib/classes/rtTPGAjaxResponse.php:98, ../lib/classes/rtTPGPreview.php:
|
33 |
msgid "Session Error !!"
|
34 |
msgstr ""
|
35 |
|
@@ -37,7 +37,7 @@ msgstr ""
|
|
37 |
msgid "Success"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:62, ../lib/classes/rtTPGOptions.php:
|
41 |
msgid "Show All"
|
42 |
msgstr ""
|
43 |
|
@@ -61,51 +61,59 @@ msgstr ""
|
|
61 |
msgid "Select Short code"
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:206, ../lib/classes/rtTPGOptions.php:
|
65 |
msgid "Default"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: ../lib/classes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
msgid "The Post Grid"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: ../lib/classes/rtTPGInit.php:
|
73 |
msgid "Add New Grid"
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: ../lib/classes/rtTPGInit.php:
|
77 |
msgid "All Grids"
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: ../lib/classes/rtTPGInit.php:
|
81 |
msgid "Add New Post Grid"
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: ../lib/classes/rtTPGInit.php:
|
85 |
msgid "Edit Post Grid"
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: ../lib/classes/rtTPGInit.php:
|
89 |
msgid "New Post Grid"
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: ../lib/classes/rtTPGInit.php:
|
93 |
msgid "View Post Grid"
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: ../lib/classes/rtTPGInit.php:
|
97 |
msgid "Search Post Grids"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: ../lib/classes/rtTPGInit.php:
|
101 |
msgid "No Post Grids found"
|
102 |
msgstr ""
|
103 |
|
104 |
-
#: ../lib/classes/rtTPGInit.php:
|
105 |
msgid "No Post Grids found in Trash"
|
106 |
msgstr ""
|
107 |
|
108 |
-
#: ../lib/classes/rtTPGInit.php:
|
109 |
msgid "Settings"
|
110 |
msgstr ""
|
111 |
|
@@ -181,7 +189,7 @@ msgstr ""
|
|
181 |
msgid "OR — show posts which match one or more settings"
|
182 |
msgstr ""
|
183 |
|
184 |
-
#: ../lib/classes/rtTPGOptions.php:50, ../lib/classes/rtTPGPreview.php:
|
185 |
msgid "Meta value"
|
186 |
msgstr ""
|
187 |
|
@@ -229,223 +237,243 @@ msgstr ""
|
|
229 |
msgid "After Loaded script"
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: ../lib/classes/rtTPGOptions.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
msgid "Deactivate License"
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: ../lib/classes/rtTPGOptions.php:
|
237 |
msgid "Activate License"
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: ../lib/classes/rtTPGOptions.php:
|
241 |
msgid "Enter your license key"
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: ../lib/classes/rtTPGOptions.php:
|
245 |
msgid "Show all"
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: ../lib/classes/rtTPGOptions.php:
|
249 |
msgid "Show all text"
|
250 |
msgstr ""
|
251 |
|
252 |
-
#: ../lib/classes/rtTPGOptions.php:
|
253 |
msgid "Speed"
|
254 |
msgstr ""
|
255 |
|
256 |
-
#: ../lib/classes/rtTPGOptions.php:
|
257 |
msgid "Auto play Speed in milliseconds"
|
258 |
msgstr ""
|
259 |
|
260 |
-
#: ../lib/classes/rtTPGOptions.php:
|
261 |
msgid "Autoplay timeout"
|
262 |
msgstr ""
|
263 |
|
264 |
-
#: ../lib/classes/rtTPGOptions.php:
|
265 |
msgid "Autoplay interval timeout"
|
266 |
msgstr ""
|
267 |
|
268 |
-
#: ../lib/classes/rtTPGOptions.php:
|
269 |
msgid "Image column"
|
270 |
msgstr ""
|
271 |
|
272 |
-
#: ../lib/classes/rtTPGOptions.php:
|
273 |
msgid "Desktop"
|
274 |
msgstr ""
|
275 |
|
276 |
-
#: ../lib/classes/rtTPGOptions.php:
|
277 |
msgid "Tab"
|
278 |
msgstr ""
|
279 |
|
280 |
-
#: ../lib/classes/rtTPGOptions.php:
|
281 |
msgid "Mobile"
|
282 |
msgstr ""
|
283 |
|
284 |
-
#: ../lib/classes/rtTPGOptions.php:
|
285 |
msgid "Image Type"
|
286 |
msgstr ""
|
287 |
|
288 |
-
#: ../lib/classes/rtTPGOptions.php:
|
289 |
msgid "Title limit"
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: ../lib/classes/rtTPGOptions.php:
|
293 |
msgid "Title limit only integer number is allowed, Leave it blank for full title."
|
294 |
msgstr ""
|
295 |
|
296 |
-
#: ../lib/classes/rtTPGOptions.php:
|
297 |
msgid "Title limit type"
|
298 |
msgstr ""
|
299 |
|
300 |
-
#: ../lib/classes/rtTPGOptions.php:
|
301 |
msgid "Excerpt limit"
|
302 |
msgstr ""
|
303 |
|
304 |
-
#: ../lib/classes/rtTPGOptions.php:
|
305 |
msgid "Excerpt limit only integer number is allowed, Leave it blank for full excerpt."
|
306 |
msgstr ""
|
307 |
|
308 |
-
#: ../lib/classes/rtTPGOptions.php:
|
309 |
msgid "Excerpt Type"
|
310 |
msgstr ""
|
311 |
|
312 |
-
#: ../lib/classes/rtTPGOptions.php:
|
313 |
msgid "Title tag"
|
314 |
msgstr ""
|
315 |
|
316 |
-
#: ../lib/classes/rtTPGOptions.php:
|
317 |
msgid "Read more button border radius"
|
318 |
msgstr ""
|
319 |
|
320 |
-
#: ../lib/classes/rtTPGOptions.php:
|
321 |
msgid "Leave it blank for default"
|
322 |
msgstr ""
|
323 |
|
324 |
-
#: ../lib/classes/rtTPGOptions.php:
|
325 |
msgid "Read more button alignment"
|
326 |
msgstr ""
|
327 |
|
328 |
-
#: ../lib/classes/rtTPGOptions.php:
|
329 |
msgid "Left"
|
330 |
msgstr ""
|
331 |
|
332 |
-
#: ../lib/classes/rtTPGOptions.php:
|
333 |
msgid "Right"
|
334 |
msgstr ""
|
335 |
|
336 |
-
#: ../lib/classes/rtTPGOptions.php:
|
337 |
msgid "Center"
|
338 |
msgstr ""
|
339 |
|
340 |
-
#: ../lib/classes/rtTPGOptions.php:
|
341 |
msgid "Title Position (Above or Below image)"
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: ../lib/classes/rtTPGOptions.php:
|
345 |
msgid "Above image"
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: ../lib/classes/rtTPGOptions.php:
|
349 |
msgid "Below image"
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: ../lib/classes/rtTPGOptions.php:
|
353 |
msgid "<span style='color:red'>Only Layout 1, Layout 12, Layout 14, Isotope1, Isotope8, Isotope10, Carousel Layout 1, Carousel Layout 8, Carousel Layout 10</span>"
|
354 |
msgstr ""
|
355 |
|
356 |
-
#: ../lib/classes/rtTPGOptions.php:
|
357 |
msgid "Character"
|
358 |
msgstr ""
|
359 |
|
360 |
-
#: ../lib/classes/rtTPGOptions.php:
|
361 |
msgid "Word"
|
362 |
msgstr ""
|
363 |
|
364 |
-
#: ../lib/classes/rtTPGOptions.php:
|
365 |
msgid "Full Content"
|
366 |
msgstr ""
|
367 |
|
368 |
-
#: ../lib/classes/rtTPGOptions.php:
|
369 |
msgid "Taxonomy filter"
|
370 |
msgstr ""
|
371 |
|
372 |
-
#: ../lib/classes/rtTPGOptions.php:
|
373 |
msgid "Author filter"
|
374 |
msgstr ""
|
375 |
|
376 |
-
#: ../lib/classes/rtTPGOptions.php:
|
377 |
msgid "Order - Sort retrieved posts by parameter"
|
378 |
msgstr ""
|
379 |
|
380 |
-
#: ../lib/classes/rtTPGOptions.php:
|
381 |
msgid "Sort Order - Designates the ascending or descending order of the \"orderby\" parameter"
|
382 |
msgstr ""
|
383 |
|
384 |
-
#: ../lib/classes/rtTPGOptions.php:
|
385 |
msgid "Search filter"
|
386 |
msgstr ""
|
387 |
|
388 |
-
#: ../lib/classes/rtTPGOptions.php:
|
389 |
msgid "Layout 1"
|
390 |
msgstr ""
|
391 |
|
392 |
-
#: ../lib/classes/rtTPGOptions.php:
|
393 |
msgid "Layout 2"
|
394 |
msgstr ""
|
395 |
|
396 |
-
#: ../lib/classes/rtTPGOptions.php:
|
397 |
msgid "Layout 3"
|
398 |
msgstr ""
|
399 |
|
400 |
-
#: ../lib/classes/rtTPGOptions.php:
|
401 |
msgid "Isotope Layout"
|
402 |
msgstr ""
|
403 |
|
404 |
-
#: ../lib/classes/rtTPGOptions.php:
|
405 |
msgid "Get Pro Version"
|
406 |
msgstr ""
|
407 |
|
408 |
-
#: ../lib/classes/rtTPGPreview.php:67, ../lib/classes/rtTPGShortCode.php:
|
409 |
msgid "Read More"
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: ../lib/classes/rtTPGPreview.php:
|
413 |
msgid "All"
|
414 |
msgstr ""
|
415 |
|
416 |
-
#: ../lib/classes/rtTPGPreview.php:
|
417 |
msgid "Sort By None"
|
418 |
msgstr ""
|
419 |
|
420 |
-
#: ../lib/classes/rtTPGPreview.php:
|
421 |
msgid "Search..."
|
422 |
msgstr ""
|
423 |
|
424 |
-
#: ../lib/classes/rtTPGPreview.php:
|
425 |
msgid "Loading ..."
|
426 |
msgstr ""
|
427 |
|
428 |
-
#: ../lib/classes/rtTPGPreview.php:
|
429 |
msgid "No post found"
|
430 |
msgstr ""
|
431 |
|
432 |
-
#: ../lib/classes/rtTPGPreview.php:
|
433 |
msgid "Search"
|
434 |
msgstr ""
|
435 |
|
436 |
-
#: ../lib/classes/rtTPGPreview.php:
|
437 |
msgid "Load More"
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: ../lib/classes/rtTPGShortCode.php:
|
441 |
msgid "No shortCode found"
|
442 |
msgstr ""
|
443 |
|
444 |
-
#: ../lib/classes/rtTPGShortCode.php:
|
445 |
msgid "This is a restricted content, you need to logged in to view this content."
|
446 |
msgstr ""
|
447 |
|
448 |
-
#: ../lib/classes/rtTPGShortCode.php:
|
449 |
msgid "You are not permitted to view this content."
|
450 |
msgstr ""
|
451 |
|
@@ -453,11 +481,11 @@ msgstr ""
|
|
453 |
msgid "Premium Option"
|
454 |
msgstr ""
|
455 |
|
456 |
-
#: ../lib/models/rtTPGField.php:
|
457 |
msgid "Start"
|
458 |
msgstr ""
|
459 |
|
460 |
-
#: ../lib/models/rtTPGField.php:
|
461 |
msgid "End"
|
462 |
msgstr ""
|
463 |
|
29 |
msgid "Server Error !!"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:71, ../lib/classes/rtTPGAjaxResponse.php:98, ../lib/classes/rtTPGPreview.php:939
|
33 |
msgid "Session Error !!"
|
34 |
msgstr ""
|
35 |
|
37 |
msgid "Success"
|
38 |
msgstr ""
|
39 |
|
40 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:62, ../lib/classes/rtTPGOptions.php:373
|
41 |
msgid "Show All"
|
42 |
msgstr ""
|
43 |
|
61 |
msgid "Select Short code"
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:206, ../lib/classes/rtTPGOptions.php:814, ../lib/classes/rtTPGOptions.php:826
|
65 |
msgid "Default"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: ../lib/classes/rtTPGHook.php:35
|
69 |
+
msgid "Facing issue?"
|
70 |
+
msgstr ""
|
71 |
+
|
72 |
+
#: ../lib/classes/rtTPGHook.php:35
|
73 |
+
msgid "Please open a support ticket."
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: ../lib/classes/rtTPGInit.php:69, ../lib/classes/rtTPGInit.php:70, ../lib/vendor/RtElementorWidget.php:10, ../lib/vendor/RtElementorWidget.php:25, ../lib/widgets/RT_TPGWidget.php:14
|
77 |
msgid "The Post Grid"
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: ../lib/classes/rtTPGInit.php:71
|
81 |
msgid "Add New Grid"
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: ../lib/classes/rtTPGInit.php:72
|
85 |
msgid "All Grids"
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: ../lib/classes/rtTPGInit.php:73
|
89 |
msgid "Add New Post Grid"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: ../lib/classes/rtTPGInit.php:74
|
93 |
msgid "Edit Post Grid"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: ../lib/classes/rtTPGInit.php:75
|
97 |
msgid "New Post Grid"
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: ../lib/classes/rtTPGInit.php:76
|
101 |
msgid "View Post Grid"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: ../lib/classes/rtTPGInit.php:77
|
105 |
msgid "Search Post Grids"
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: ../lib/classes/rtTPGInit.php:78
|
109 |
msgid "No Post Grids found"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: ../lib/classes/rtTPGInit.php:79
|
113 |
msgid "No Post Grids found in Trash"
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: ../lib/classes/rtTPGInit.php:168
|
117 |
msgid "Settings"
|
118 |
msgstr ""
|
119 |
|
189 |
msgid "OR — show posts which match one or more settings"
|
190 |
msgstr ""
|
191 |
|
192 |
+
#: ../lib/classes/rtTPGOptions.php:50, ../lib/classes/rtTPGPreview.php:656, ../lib/classes/rtTPGShortCode.php:708
|
193 |
msgid "Meta value"
|
194 |
msgstr ""
|
195 |
|
237 |
msgid "After Loaded script"
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: ../lib/classes/rtTPGOptions.php:111
|
241 |
+
msgid "Load Script only ShortCode page"
|
242 |
+
msgstr ""
|
243 |
+
|
244 |
+
#: ../lib/classes/rtTPGOptions.php:112
|
245 |
+
msgid "If you enable this, script will be loaded only ShortCode page."
|
246 |
+
msgstr ""
|
247 |
+
|
248 |
+
#: ../lib/classes/rtTPGOptions.php:118
|
249 |
+
msgid "Enable Pre-loader"
|
250 |
+
msgstr ""
|
251 |
+
|
252 |
+
#: ../lib/classes/rtTPGOptions.php:125
|
253 |
+
msgid "Disable Font Awesome Script"
|
254 |
+
msgstr ""
|
255 |
+
|
256 |
+
#: ../lib/classes/rtTPGOptions.php:126
|
257 |
+
msgid "If Font Awesome 5 exist with theme, don't need to load twice."
|
258 |
+
msgstr ""
|
259 |
+
|
260 |
+
#: ../lib/classes/rtTPGOptions.php:188
|
261 |
msgid "Deactivate License"
|
262 |
msgstr ""
|
263 |
|
264 |
+
#: ../lib/classes/rtTPGOptions.php:189
|
265 |
msgid "Activate License"
|
266 |
msgstr ""
|
267 |
|
268 |
+
#: ../lib/classes/rtTPGOptions.php:197
|
269 |
msgid "Enter your license key"
|
270 |
msgstr ""
|
271 |
|
272 |
+
#: ../lib/classes/rtTPGOptions.php:403, ../lib/classes/rtTPGOptions.php:409, ../lib/classes/rtTPGPreview.php:69, ../lib/classes/rtTPGShortCode.php:150
|
273 |
msgid "Show all"
|
274 |
msgstr ""
|
275 |
|
276 |
+
#: ../lib/classes/rtTPGOptions.php:408
|
277 |
msgid "Show all text"
|
278 |
msgstr ""
|
279 |
|
280 |
+
#: ../lib/classes/rtTPGOptions.php:455
|
281 |
msgid "Speed"
|
282 |
msgstr ""
|
283 |
|
284 |
+
#: ../lib/classes/rtTPGOptions.php:459
|
285 |
msgid "Auto play Speed in milliseconds"
|
286 |
msgstr ""
|
287 |
|
288 |
+
#: ../lib/classes/rtTPGOptions.php:462
|
289 |
msgid "Autoplay timeout"
|
290 |
msgstr ""
|
291 |
|
292 |
+
#: ../lib/classes/rtTPGOptions.php:466
|
293 |
msgid "Autoplay interval timeout"
|
294 |
msgstr ""
|
295 |
|
296 |
+
#: ../lib/classes/rtTPGOptions.php:470
|
297 |
msgid "Image column"
|
298 |
msgstr ""
|
299 |
|
300 |
+
#: ../lib/classes/rtTPGOptions.php:479
|
301 |
msgid "Desktop"
|
302 |
msgstr ""
|
303 |
|
304 |
+
#: ../lib/classes/rtTPGOptions.php:488
|
305 |
msgid "Tab"
|
306 |
msgstr ""
|
307 |
|
308 |
+
#: ../lib/classes/rtTPGOptions.php:497
|
309 |
msgid "Mobile"
|
310 |
msgstr ""
|
311 |
|
312 |
+
#: ../lib/classes/rtTPGOptions.php:566
|
313 |
msgid "Image Type"
|
314 |
msgstr ""
|
315 |
|
316 |
+
#: ../lib/classes/rtTPGOptions.php:574
|
317 |
msgid "Title limit"
|
318 |
msgstr ""
|
319 |
|
320 |
+
#: ../lib/classes/rtTPGOptions.php:575
|
321 |
msgid "Title limit only integer number is allowed, Leave it blank for full title."
|
322 |
msgstr ""
|
323 |
|
324 |
+
#: ../lib/classes/rtTPGOptions.php:579
|
325 |
msgid "Title limit type"
|
326 |
msgstr ""
|
327 |
|
328 |
+
#: ../lib/classes/rtTPGOptions.php:586
|
329 |
msgid "Excerpt limit"
|
330 |
msgstr ""
|
331 |
|
332 |
+
#: ../lib/classes/rtTPGOptions.php:587
|
333 |
msgid "Excerpt limit only integer number is allowed, Leave it blank for full excerpt."
|
334 |
msgstr ""
|
335 |
|
336 |
+
#: ../lib/classes/rtTPGOptions.php:591
|
337 |
msgid "Excerpt Type"
|
338 |
msgstr ""
|
339 |
|
340 |
+
#: ../lib/classes/rtTPGOptions.php:607
|
341 |
msgid "Title tag"
|
342 |
msgstr ""
|
343 |
|
344 |
+
#: ../lib/classes/rtTPGOptions.php:807
|
345 |
msgid "Read more button border radius"
|
346 |
msgstr ""
|
347 |
|
348 |
+
#: ../lib/classes/rtTPGOptions.php:808
|
349 |
msgid "Leave it blank for default"
|
350 |
msgstr ""
|
351 |
|
352 |
+
#: ../lib/classes/rtTPGOptions.php:813
|
353 |
msgid "Read more button alignment"
|
354 |
msgstr ""
|
355 |
|
356 |
+
#: ../lib/classes/rtTPGOptions.php:816
|
357 |
msgid "Left"
|
358 |
msgstr ""
|
359 |
|
360 |
+
#: ../lib/classes/rtTPGOptions.php:817
|
361 |
msgid "Right"
|
362 |
msgstr ""
|
363 |
|
364 |
+
#: ../lib/classes/rtTPGOptions.php:818
|
365 |
msgid "Center"
|
366 |
msgstr ""
|
367 |
|
368 |
+
#: ../lib/classes/rtTPGOptions.php:823
|
369 |
msgid "Title Position (Above or Below image)"
|
370 |
msgstr ""
|
371 |
|
372 |
+
#: ../lib/classes/rtTPGOptions.php:828
|
373 |
msgid "Above image"
|
374 |
msgstr ""
|
375 |
|
376 |
+
#: ../lib/classes/rtTPGOptions.php:829
|
377 |
msgid "Below image"
|
378 |
msgstr ""
|
379 |
|
380 |
+
#: ../lib/classes/rtTPGOptions.php:831
|
381 |
msgid "<span style='color:red'>Only Layout 1, Layout 12, Layout 14, Isotope1, Isotope8, Isotope10, Carousel Layout 1, Carousel Layout 8, Carousel Layout 10</span>"
|
382 |
msgstr ""
|
383 |
|
384 |
+
#: ../lib/classes/rtTPGOptions.php:914
|
385 |
msgid "Character"
|
386 |
msgstr ""
|
387 |
|
388 |
+
#: ../lib/classes/rtTPGOptions.php:915
|
389 |
msgid "Word"
|
390 |
msgstr ""
|
391 |
|
392 |
+
#: ../lib/classes/rtTPGOptions.php:918
|
393 |
msgid "Full Content"
|
394 |
msgstr ""
|
395 |
|
396 |
+
#: ../lib/classes/rtTPGOptions.php:937
|
397 |
msgid "Taxonomy filter"
|
398 |
msgstr ""
|
399 |
|
400 |
+
#: ../lib/classes/rtTPGOptions.php:938
|
401 |
msgid "Author filter"
|
402 |
msgstr ""
|
403 |
|
404 |
+
#: ../lib/classes/rtTPGOptions.php:939
|
405 |
msgid "Order - Sort retrieved posts by parameter"
|
406 |
msgstr ""
|
407 |
|
408 |
+
#: ../lib/classes/rtTPGOptions.php:940
|
409 |
msgid "Sort Order - Designates the ascending or descending order of the \"orderby\" parameter"
|
410 |
msgstr ""
|
411 |
|
412 |
+
#: ../lib/classes/rtTPGOptions.php:941
|
413 |
msgid "Search filter"
|
414 |
msgstr ""
|
415 |
|
416 |
+
#: ../lib/classes/rtTPGOptions.php:961
|
417 |
msgid "Layout 1"
|
418 |
msgstr ""
|
419 |
|
420 |
+
#: ../lib/classes/rtTPGOptions.php:962
|
421 |
msgid "Layout 2"
|
422 |
msgstr ""
|
423 |
|
424 |
+
#: ../lib/classes/rtTPGOptions.php:963
|
425 |
msgid "Layout 3"
|
426 |
msgstr ""
|
427 |
|
428 |
+
#: ../lib/classes/rtTPGOptions.php:964
|
429 |
msgid "Isotope Layout"
|
430 |
msgstr ""
|
431 |
|
432 |
+
#: ../lib/classes/rtTPGOptions.php:1089
|
433 |
msgid "Get Pro Version"
|
434 |
msgstr ""
|
435 |
|
436 |
+
#: ../lib/classes/rtTPGPreview.php:67, ../lib/classes/rtTPGShortCode.php:148
|
437 |
msgid "Read More"
|
438 |
msgstr ""
|
439 |
|
440 |
+
#: ../lib/classes/rtTPGPreview.php:420, ../lib/classes/rtTPGShortCode.php:475
|
441 |
msgid "All"
|
442 |
msgstr ""
|
443 |
|
444 |
+
#: ../lib/classes/rtTPGPreview.php:654, ../lib/classes/rtTPGPreview.php:661, ../lib/classes/rtTPGShortCode.php:706, ../lib/classes/rtTPGShortCode.php:713
|
445 |
msgid "Sort By None"
|
446 |
msgstr ""
|
447 |
|
448 |
+
#: ../lib/classes/rtTPGPreview.php:679, ../lib/classes/rtTPGShortCode.php:731
|
449 |
msgid "Search..."
|
450 |
msgstr ""
|
451 |
|
452 |
+
#: ../lib/classes/rtTPGPreview.php:687, ../lib/classes/rtTPGShortCode.php:739
|
453 |
msgid "Loading ..."
|
454 |
msgstr ""
|
455 |
|
456 |
+
#: ../lib/classes/rtTPGPreview.php:868, ../lib/classes/rtTPGShortCode.php:911
|
457 |
msgid "No post found"
|
458 |
msgstr ""
|
459 |
|
460 |
+
#: ../lib/classes/rtTPGPreview.php:771, ../lib/classes/rtTPGShortCode.php:820
|
461 |
msgid "Search"
|
462 |
msgstr ""
|
463 |
|
464 |
+
#: ../lib/classes/rtTPGPreview.php:902, ../lib/classes/rtTPGPreview.php:897, ../lib/classes/rtTPGShortCode.php:937
|
465 |
msgid "Load More"
|
466 |
msgstr ""
|
467 |
|
468 |
+
#: ../lib/classes/rtTPGShortCode.php:975
|
469 |
msgid "No shortCode found"
|
470 |
msgstr ""
|
471 |
|
472 |
+
#: ../lib/classes/rtTPGShortCode.php:995
|
473 |
msgid "This is a restricted content, you need to logged in to view this content."
|
474 |
msgstr ""
|
475 |
|
476 |
+
#: ../lib/classes/rtTPGShortCode.php:989
|
477 |
msgid "You are not permitted to view this content."
|
478 |
msgstr ""
|
479 |
|
481 |
msgid "Premium Option"
|
482 |
msgstr ""
|
483 |
|
484 |
+
#: ../lib/models/rtTPGField.php:367
|
485 |
msgid "Start"
|
486 |
msgstr ""
|
487 |
|
488 |
+
#: ../lib/models/rtTPGField.php:376
|
489 |
msgid "End"
|
490 |
msgstr ""
|
491 |
|
lib/classes/rtTPGFrontEnd.php
CHANGED
@@ -8,11 +8,13 @@ if (!class_exists('rtTPGFrontEnd')):
|
|
8 |
}
|
9 |
|
10 |
function rt_tpg_enqueue_styles() {
|
11 |
-
wp_enqueue_style('rt-tpg');
|
12 |
$settings = get_option(rtTPG()->options['settings']);
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
16 |
}
|
17 |
$scriptBefore = isset($settings['script_before_item_load']) ? stripslashes($settings['script_before_item_load']) : null;
|
18 |
$scriptAfter = isset($settings['script_after_item_load']) ? stripslashes($settings['script_after_item_load']) : null;
|
8 |
}
|
9 |
|
10 |
function rt_tpg_enqueue_styles() {
|
|
|
11 |
$settings = get_option(rtTPG()->options['settings']);
|
12 |
+
if (!isset($settings['tpg_load_script'])) {
|
13 |
+
wp_enqueue_style('rt-tpg');
|
14 |
+
$css = isset($settings['custom_css']) ? stripslashes($settings['custom_css']) : null;
|
15 |
+
if ($css) {
|
16 |
+
wp_add_inline_style('rt-tpg', $css);
|
17 |
+
}
|
18 |
}
|
19 |
$scriptBefore = isset($settings['script_before_item_load']) ? stripslashes($settings['script_before_item_load']) : null;
|
20 |
$scriptAfter = isset($settings['script_after_item_load']) ? stripslashes($settings['script_after_item_load']) : null;
|
lib/classes/rtTPGHelper.php
CHANGED
@@ -508,19 +508,23 @@ if (!class_exists('rtTPGHelper')):
|
|
508 |
$matches)
|
509 |
) {
|
510 |
$imgSrc = $matches[1][0];
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
|
|
|
|
517 |
|
518 |
$image = "<img class='{$img_class}' src='{$imgSrc}' {$size} alt='{$alt}'>";
|
519 |
}
|
520 |
}
|
|
|
521 |
if (!$imgSrc && $defaultImgId) {
|
522 |
$image = wp_get_attachment_image($defaultImgId, $fImgSize);
|
523 |
}
|
|
|
524 |
if ($imgSrc && $cSize) {
|
525 |
$w = (!empty($customImgSize[0]) ? absint($customImgSize[0]) : null);
|
526 |
$h = (!empty($customImgSize[1]) ? absint($customImgSize[1]) : null);
|
508 |
$matches)
|
509 |
) {
|
510 |
$imgSrc = $matches[1][0];
|
511 |
+
$size = '';
|
512 |
+
|
513 |
+
$imgAbs = str_replace(trailingslashit(site_url()),ABSPATH, $imgSrc);
|
514 |
+
|
515 |
+
if (file_exists($imgAbs)) {
|
516 |
+
$info = getimagesize($imgAbs);
|
517 |
+
$size = isset($info[3]) ? $info[3] : '';
|
518 |
+
}
|
519 |
|
520 |
$image = "<img class='{$img_class}' src='{$imgSrc}' {$size} alt='{$alt}'>";
|
521 |
}
|
522 |
}
|
523 |
+
|
524 |
if (!$imgSrc && $defaultImgId) {
|
525 |
$image = wp_get_attachment_image($defaultImgId, $fImgSize);
|
526 |
}
|
527 |
+
|
528 |
if ($imgSrc && $cSize) {
|
529 |
$w = (!empty($customImgSize[0]) ? absint($customImgSize[0]) : null);
|
530 |
$h = (!empty($customImgSize[1]) ? absint($customImgSize[1]) : null);
|
lib/classes/rtTPGHook.php
CHANGED
@@ -5,7 +5,7 @@ if (!class_exists('rtTPGHook')):
|
|
5 |
function __construct() {
|
6 |
add_filter('tpg_author_arg', array(__CLASS__, 'filter_author_args'), 10);
|
7 |
add_action('pre_get_posts', array(__CLASS__, 'category_query'), 10);
|
8 |
-
|
9 |
}
|
10 |
|
11 |
static function category_query($query) {
|
@@ -23,13 +23,21 @@ if (!class_exists('rtTPGHook')):
|
|
23 |
}
|
24 |
}
|
25 |
|
26 |
-
|
27 |
static function filter_author_args($args) {
|
28 |
$defaults = array('role__in' => array('administrator', 'editor', 'author'));
|
29 |
|
30 |
return wp_parse_args($args, $defaults);
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
endif;
|
5 |
function __construct() {
|
6 |
add_filter('tpg_author_arg', array(__CLASS__, 'filter_author_args'), 10);
|
7 |
add_action('pre_get_posts', array(__CLASS__, 'category_query'), 10);
|
8 |
+
add_filter('plugin_row_meta', array(__CLASS__, 'plugin_row_meta'), 10, 2);
|
9 |
}
|
10 |
|
11 |
static function category_query($query) {
|
23 |
}
|
24 |
}
|
25 |
|
|
|
26 |
static function filter_author_args($args) {
|
27 |
$defaults = array('role__in' => array('administrator', 'editor', 'author'));
|
28 |
|
29 |
return wp_parse_args($args, $defaults);
|
30 |
}
|
31 |
|
32 |
+
static public function plugin_row_meta($links, $file) {
|
33 |
+
if ($file == RT_THE_POST_GRID_PLUGIN_ACTIVE_FILE_NAME) {
|
34 |
+
$report_url = 'https://www.radiustheme.com/contact/';
|
35 |
+
$row_meta['issues'] = sprintf('%2$s <a target="_blank" href="%1$s">%3$s</a>', esc_url($report_url), esc_html__('Facing issue?', 'the-post-grid'), '<span style="color: red">' . esc_html__('Please open a support ticket.', 'the-post-grid') . '</span>');
|
36 |
+
return array_merge($links, $row_meta);
|
37 |
+
}
|
38 |
+
return (array)$links;
|
39 |
+
}
|
40 |
+
|
41 |
}
|
42 |
|
43 |
endif;
|
lib/classes/rtTPGInit.php
CHANGED
@@ -18,6 +18,16 @@ if (!class_exists('rtTPGInit')):
|
|
18 |
'rt_post_grid_marketing'
|
19 |
));
|
20 |
add_action('admin_enqueue_scripts', array($this, 'settings_admin_enqueue_scripts'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
}
|
22 |
|
23 |
function the_post_grid_remove_all_meta_box() {
|
18 |
'rt_post_grid_marketing'
|
19 |
));
|
20 |
add_action('admin_enqueue_scripts', array($this, 'settings_admin_enqueue_scripts'));
|
21 |
+
add_action( 'wp_print_styles', [$this, 'tpg_dequeue_unnecessary_styles'], 99 );
|
22 |
+
}
|
23 |
+
|
24 |
+
function tpg_dequeue_unnecessary_styles() {
|
25 |
+
$settings = get_option(rtTPG()->options['settings']);
|
26 |
+
|
27 |
+
if (isset($settings['tpg_skip_fa'])) {
|
28 |
+
wp_dequeue_style( 'rt-fontawsome' );
|
29 |
+
wp_deregister_style( 'rt-fontawsome' );
|
30 |
+
}
|
31 |
}
|
32 |
|
33 |
function the_post_grid_remove_all_meta_box() {
|
lib/classes/rtTPGOptions.php
CHANGED
@@ -105,6 +105,27 @@ if (!class_exists('rtTPGOptions')):
|
|
105 |
$settings = get_option(rtTPG()->options['settings']);
|
106 |
|
107 |
return array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
'template_author' => array(
|
109 |
'type' => 'select',
|
110 |
'name' => 'template_author',
|
105 |
$settings = get_option(rtTPG()->options['settings']);
|
106 |
|
107 |
return array(
|
108 |
+
'tpg_load_script' => array(
|
109 |
+
'type' => 'switch',
|
110 |
+
'name' => 'tpg_load_script',
|
111 |
+
'label' => __('Load Script only ShortCode page', 'the-post-grid'),
|
112 |
+
'description' => __('If you enable this, script will be loaded only ShortCode page.', 'the-post-grid'),
|
113 |
+
'value' => isset($settings['tpg_load_script']) ? $settings['tpg_load_script'] : false,
|
114 |
+
),
|
115 |
+
'tpg_enable_preloader' => array(
|
116 |
+
'type' => 'switch',
|
117 |
+
'name' => 'tpg_enable_preloader',
|
118 |
+
'label' => __('Enable Pre-loader', 'the-post-grid'),
|
119 |
+
'holderClass' => 'tpg-hidden',
|
120 |
+
'value' => isset($settings['tpg_enable_preloader']) ? $settings['tpg_enable_preloader'] : false,
|
121 |
+
),
|
122 |
+
'tpg_skip_fa' => array(
|
123 |
+
'type' => 'switch',
|
124 |
+
'name' => 'tpg_skip_fa',
|
125 |
+
'label' => __('Disable Font Awesome Script', 'the-post-grid'),
|
126 |
+
'description' => __("If Font Awesome 5 exist with theme, don't need to load twice." , 'the-post-grid'),
|
127 |
+
'value' => isset($settings['tpg_enable_preloader']) ? $settings['tpg_enable_preloader'] : false,
|
128 |
+
),
|
129 |
'template_author' => array(
|
130 |
'type' => 'select',
|
131 |
'name' => 'template_author',
|
lib/classes/rtTPGPreview.php
CHANGED
@@ -211,10 +211,10 @@ if ( ! class_exists( 'rtTPGPreview' ) ):
|
|
211 |
$post_status = ( isset( $scMeta['tpg_post_status'] ) ? $scMeta['tpg_post_status'] : array() );
|
212 |
if ( ! empty( $post_status ) ) {
|
213 |
$args['post_status'] = $post_status;
|
214 |
-
} else {
|
215 |
-
$args['post_status'] = 'publish';
|
216 |
}
|
217 |
-
}
|
|
|
|
|
218 |
// Author
|
219 |
$filterAuthors = array();
|
220 |
$author = ( isset( $scMeta['author'] ) ? $scMeta['author'] : array() );
|
@@ -273,7 +273,6 @@ if ( ! class_exists( 'rtTPGPreview' ) ):
|
|
273 |
$args['posts_per_archive_page'] = $args['posts_per_page'];
|
274 |
}
|
275 |
|
276 |
-
|
277 |
// Validation
|
278 |
$containerDataAttr = null;
|
279 |
$containerDataAttr .= " data-layout='{$layout}' data-desktop-col='{$dCol}' data-tab-col='{$tCol}' data-mobile-col='{$mCol}'";
|
211 |
$post_status = ( isset( $scMeta['tpg_post_status'] ) ? $scMeta['tpg_post_status'] : array() );
|
212 |
if ( ! empty( $post_status ) ) {
|
213 |
$args['post_status'] = $post_status;
|
|
|
|
|
214 |
}
|
215 |
+
} else {
|
216 |
+
$args['post_status'] = 'publish';
|
217 |
+
}
|
218 |
// Author
|
219 |
$filterAuthors = array();
|
220 |
$author = ( isset( $scMeta['author'] ) ? $scMeta['author'] : array() );
|
273 |
$args['posts_per_archive_page'] = $args['posts_per_page'];
|
274 |
}
|
275 |
|
|
|
276 |
// Validation
|
277 |
$containerDataAttr = null;
|
278 |
$containerDataAttr .= " data-layout='{$layout}' data-desktop-col='{$dCol}' data-tab-col='{$tCol}' data-mobile-col='{$mCol}'";
|
lib/classes/rtTPGShortCode.php
CHANGED
@@ -1,997 +1,1010 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! class_exists( 'rtTPGShortCode' ) ):
|
4 |
-
|
5 |
-
class rtTPGShortCode {
|
6 |
-
|
7 |
-
private $scA = array();
|
8 |
-
private $l4toggle = false;
|
9 |
-
|
10 |
-
function __construct() {
|
11 |
-
add_shortcode( 'the-post-grid', array( $this, 'the_post_grid_short_code' ) );
|
12 |
-
add_action( 'pre_get_posts', array( $this, 'make_sticky_work' ) );
|
13 |
-
}
|
14 |
-
|
15 |
-
function make_sticky_work( $q ) {
|
16 |
-
if ( true === $q->get( 'wp_tpg_is_home' ) ) {
|
17 |
-
$q->is_home = true;
|
18 |
-
}
|
19 |
-
}
|
20 |
-
|
21 |
-
function register_sc_scripts() {
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
$
|
26 |
-
|
27 |
-
$
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
$ajaxurl .= admin_url( 'admin-ajax.php' );
|
32 |
-
}
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
'
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
array_push( $script, '
|
53 |
-
array_push( $
|
54 |
-
array_push( $script, 'rt-
|
55 |
-
array_push( $
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
$html
|
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 |
-
$arg
|
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 |
-
$args['
|
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 |
-
$arg_class
|
337 |
-
if ( $
|
338 |
-
$arg_class[] =
|
339 |
-
}
|
340 |
-
|
341 |
-
$
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
if ( $
|
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 |
-
if ( $
|
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 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
$
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
$
|
529 |
-
}
|
530 |
-
$
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
$
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
$
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
$
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
$
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
$
|
703 |
-
$
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
$
|
708 |
-
|
709 |
-
|
710 |
-
$
|
711 |
-
}
|
712 |
-
$
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
$html .=
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
$
|
733 |
-
$
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
$
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
if (
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
$
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
$
|
808 |
-
|
809 |
-
}
|
810 |
-
$
|
811 |
-
|
812 |
-
$
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
if (
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
$
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
$
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
$
|
876 |
-
$
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
$
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
<span class='rt-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
$
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
$
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
$
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists( 'rtTPGShortCode' ) ):
|
4 |
+
|
5 |
+
class rtTPGShortCode {
|
6 |
+
|
7 |
+
private $scA = array();
|
8 |
+
private $l4toggle = false;
|
9 |
+
|
10 |
+
function __construct() {
|
11 |
+
add_shortcode( 'the-post-grid', array( $this, 'the_post_grid_short_code' ) );
|
12 |
+
add_action( 'pre_get_posts', array( $this, 'make_sticky_work' ) );
|
13 |
+
}
|
14 |
+
|
15 |
+
function make_sticky_work( $q ) {
|
16 |
+
if ( true === $q->get( 'wp_tpg_is_home' ) ) {
|
17 |
+
$q->is_home = true;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
function register_sc_scripts() {
|
22 |
+
|
23 |
+
$settings = get_option(rtTPG()->options['settings']);
|
24 |
+
|
25 |
+
$caro = $isSinglePopUp = false;
|
26 |
+
$script = array();
|
27 |
+
$style = array();
|
28 |
+
array_push( $script, 'jquery' );
|
29 |
+
$ajaxurl = '';
|
30 |
+
if ( in_array( 'sitepress-multilingual-cms/sitepress.php', get_option( 'active_plugins' ) ) ) {
|
31 |
+
$ajaxurl .= admin_url( 'admin-ajax.php?lang=' . ICL_LANGUAGE_CODE );
|
32 |
+
} else {
|
33 |
+
$ajaxurl .= admin_url( 'admin-ajax.php' );
|
34 |
+
}
|
35 |
+
$variables = array(
|
36 |
+
'nonceID' => rtTPG()->nonceId(),
|
37 |
+
'nonce' => wp_create_nonce( rtTPG()->nonceText() ),
|
38 |
+
'ajaxurl' => $ajaxurl
|
39 |
+
);
|
40 |
+
foreach ( $this->scA as $sc ) {
|
41 |
+
if ( isset( $sc ) && is_array( $sc ) ) {
|
42 |
+
if ( $sc['isSinglePopUp'] ) {
|
43 |
+
$isSinglePopUp = true;
|
44 |
+
}
|
45 |
+
if ( $sc['isWooCom'] ) {
|
46 |
+
$variables['woocommerce_enable_ajax_add_to_cart'] = get_option( 'woocommerce_enable_ajax_add_to_cart' );
|
47 |
+
$variables['woocommerce_cart_redirect_after_add'] = get_option( 'woocommerce_cart_redirect_after_add' );
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
if ( count( $this->scA ) ) {
|
52 |
+
array_push( $script, 'jquery' );
|
53 |
+
array_push( $script, 'rt-image-load-js' );
|
54 |
+
array_push( $script, 'rt-isotope-js' );
|
55 |
+
array_push( $style, 'rt-fontawsome' );
|
56 |
+
array_push( $script, 'rt-actual-height-js' );
|
57 |
+
array_push( $script, 'rt-tpg' );
|
58 |
+
|
59 |
+
if (isset($settings['tpg_load_script'])) {
|
60 |
+
wp_enqueue_style('rt-tpg');
|
61 |
+
$css = isset($settings['custom_css']) ? stripslashes($settings['custom_css']) : null;
|
62 |
+
if ($css) {
|
63 |
+
wp_add_inline_style('rt-tpg', $css);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
if ( is_rtl() ) {
|
68 |
+
array_push( $style, 'rt-tpg-rtl' );
|
69 |
+
}
|
70 |
+
wp_enqueue_style( $style );
|
71 |
+
wp_enqueue_script( $script );
|
72 |
+
wp_localize_script( 'rt-tpg', 'rttpg', $variables );
|
73 |
+
|
74 |
+
do_action( 'tpg_after_script', $isSinglePopUp );
|
75 |
+
|
76 |
+
}
|
77 |
+
|
78 |
+
if ( $isSinglePopUp && rtTPG()->hasPro() ) {
|
79 |
+
$html = null;
|
80 |
+
$html .= '<div class="md-modal rt-md-effect" id="rt-modal">
|
81 |
+
<div class="md-content">
|
82 |
+
<div class="rt-md-content-holder">
|
83 |
+
|
84 |
+
</div>
|
85 |
+
<div class="md-cls-btn">
|
86 |
+
<button class="md-close"><i class="fa fa-times" aria-hidden="true"></i></button>
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
</div>';
|
90 |
+
$html .= "<div class='md-overlay'></div>";
|
91 |
+
echo $html;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
function the_post_grid_short_code( $atts, $content = null ) {
|
96 |
+
$rand = mt_rand();
|
97 |
+
|
98 |
+
$layoutID = "rt-tpg-container-" . $rand;
|
99 |
+
|
100 |
+
$html = null;
|
101 |
+
$arg = array();
|
102 |
+
$atts = shortcode_atts( array(
|
103 |
+
'id' => null
|
104 |
+
), $atts, 'the-post-grid' );
|
105 |
+
$scID = $atts['id'];
|
106 |
+
if ( $scID && ! is_null( get_post( $scID ) ) ) {
|
107 |
+
$scMeta = get_post_meta( $scID );
|
108 |
+
|
109 |
+
$layout = ( isset( $scMeta['layout'][0] ) ? $scMeta['layout'][0] : 'layout1' );
|
110 |
+
if ( ! in_array( $layout, array_keys( rtTPG()->rtTPGLayouts() ) ) ) {
|
111 |
+
$layout = 'layout1';
|
112 |
+
}
|
113 |
+
|
114 |
+
$isIsotope = preg_match( '/isotope/', $layout );
|
115 |
+
$isCarousel = preg_match( '/carousel/', $layout );
|
116 |
+
$isGrid = preg_match( '/layout/', $layout );
|
117 |
+
$isWooCom = preg_match( '/wc/', $layout );
|
118 |
+
$isEdd = preg_match( '/edd/', $layout );
|
119 |
+
$isOffset = preg_match( '/offset/', $layout );
|
120 |
+
|
121 |
+
$colStore = $dCol = ( isset( $scMeta['column'][0] ) ? absint( $scMeta['column'][0] ) : 3 );
|
122 |
+
$tCol = ( isset( $scMeta['tpg_tab_column'][0] ) ? absint( $scMeta['tpg_tab_column'][0] ) : 2 );
|
123 |
+
$mCol = ( isset( $scMeta['tpg_mobile_column'][0] ) ? absint( $scMeta['tpg_mobile_column'][0] ) : 1 );
|
124 |
+
if ( ! in_array( $dCol, array_keys( rtTPG()->scColumns() ) ) ) {
|
125 |
+
$dCol = 3;
|
126 |
+
}
|
127 |
+
if ( ! in_array( $tCol, array_keys( rtTPG()->scColumns() ) ) ) {
|
128 |
+
$tCol = 2;
|
129 |
+
}
|
130 |
+
if ( ! in_array( $dCol, array_keys( rtTPG()->scColumns() ) ) ) {
|
131 |
+
$mCol = 1;
|
132 |
+
}
|
133 |
+
|
134 |
+
if ( $isOffset ) {
|
135 |
+
$dCol = ( $dCol < 3 ? 2 : $dCol );
|
136 |
+
$tCol = ( $tCol < 3 ? 2 : $tCol );
|
137 |
+
$mCol = ( $mCol < 3 ? 1 : $mCol );
|
138 |
+
}
|
139 |
+
$arg = array();
|
140 |
+
$fImg = ( ! empty( $scMeta['feature_image'][0] ) ? true : false );
|
141 |
+
$fImgSize = ( isset( $scMeta['featured_image_size'][0] ) ? $scMeta['featured_image_size'][0] : "medium" );
|
142 |
+
$mediaSource = ( isset( $scMeta['media_source'][0] ) ? $scMeta['media_source'][0] : "feature_image" );
|
143 |
+
$arg['excerpt_type'] = ( isset( $scMeta['tgp_excerpt_type'][0] ) ? $scMeta['tgp_excerpt_type'][0] : 'character' );
|
144 |
+
$arg['title_limit_type'] = ( isset( $scMeta['tpg_title_limit_type'][0] ) ? $scMeta['tpg_title_limit_type'][0] : 'character' );
|
145 |
+
$arg['excerpt_limit'] = ( isset( $scMeta['excerpt_limit'][0] ) ? absint( $scMeta['excerpt_limit'][0] ) : 0 );
|
146 |
+
$arg['title_limit'] = ( isset( $scMeta['tpg_title_limit'][0] ) ? absint( $scMeta['tpg_title_limit'][0] ) : 0 );
|
147 |
+
$arg['excerpt_more_text'] = ( isset( $scMeta['tgp_excerpt_more_text'][0] ) ? $scMeta['tgp_excerpt_more_text'][0] : null );
|
148 |
+
$arg['read_more_text'] = ( ! empty( $scMeta['tgp_read_more_text'][0] ) ? $scMeta['tgp_read_more_text'][0] : __( 'Read More',
|
149 |
+
'the-post-grid' ) );
|
150 |
+
$arg['show_all_text'] = ( ! empty( $scMeta['tpg_show_all_text'][0] ) ? $scMeta['tpg_show_all_text'][0] : __( 'Show all',
|
151 |
+
'the-post-grid' ) );
|
152 |
+
$arg['tpg_title_position'] = isset( $scMeta['tpg_title_position'][0] ) && ! empty( $scMeta['tpg_title_position'][0] ) ? $scMeta['tpg_title_position'][0] : null;
|
153 |
+
$arg['btn_alignment_class'] = isset( $scMeta['tpg_read_more_button_alignment'][0] ) && ! empty( $scMeta['tpg_read_more_button_alignment'][0] ) ? $scMeta['tpg_read_more_button_alignment'][0] : '';
|
154 |
+
|
155 |
+
/* Argument create */
|
156 |
+
$args = array();
|
157 |
+
$postType = ( isset( $scMeta['tpg_post_type'][0] ) ? $scMeta['tpg_post_type'][0] : 'post' );
|
158 |
+
if ( $postType ) {
|
159 |
+
$args['post_type'] = $postType;
|
160 |
+
}
|
161 |
+
|
162 |
+
// Common filter
|
163 |
+
/* post__in */
|
164 |
+
$post__in = ( isset( $scMeta['post__in'][0] ) ? $scMeta['post__in'][0] : null );
|
165 |
+
if ( $post__in ) {
|
166 |
+
$post__in = explode( ',', $post__in );
|
167 |
+
$args['post__in'] = $post__in;
|
168 |
+
}
|
169 |
+
/* post__not_in */
|
170 |
+
$post__not_in = ( isset( $scMeta['post__not_in'][0] ) ? $scMeta['post__not_in'][0] : null );
|
171 |
+
if ( $post__not_in ) {
|
172 |
+
$post__not_in = explode( ',', $post__not_in );
|
173 |
+
$args['post__not_in'] = $post__not_in;
|
174 |
+
}
|
175 |
+
|
176 |
+
/* LIMIT */
|
177 |
+
$limit = ( ( empty( $scMeta['limit'][0] ) || $scMeta['limit'][0] === '-1' ) ? - 1 : absint( $scMeta['limit'][0] ) );
|
178 |
+
$args['posts_per_page'] = $limit;
|
179 |
+
$pagination = ! empty( $scMeta['pagination'][0] );
|
180 |
+
$posts_loading_type = ( ! empty( $scMeta['posts_loading_type'][0] ) ? $scMeta['posts_loading_type'][0] : "pagination" );
|
181 |
+
if ( $pagination ) {
|
182 |
+
$posts_per_page = ( isset( $scMeta['posts_per_page'][0] ) ? intval( $scMeta['posts_per_page'][0] ) : $limit );
|
183 |
+
$args['posts_per_page'] = $posts_per_page;
|
184 |
+
$args['paged'] = get_query_var( 'page' ) ? get_query_var( 'page' ) : ( get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1 );
|
185 |
+
}
|
186 |
+
|
187 |
+
// Advance Filter
|
188 |
+
$adv_filter = get_post_meta( $scID, 'post_filter' );
|
189 |
+
$taxFilter = get_post_meta( $scID, 'tgp_filter_taxonomy', true );
|
190 |
+
$taxHierarchical = get_post_meta( $scID, 'tgp_filter_taxonomy_hierarchical', true );
|
191 |
+
$taxFilterTerms = array();
|
192 |
+
$taxFilterOperator = "IN";
|
193 |
+
// Taxonomy
|
194 |
+
$taxQ = array();
|
195 |
+
if ( in_array( 'tpg_taxonomy', $adv_filter ) && isset( $scMeta['tpg_taxonomy'] ) ) {
|
196 |
+
|
197 |
+
if ( is_array( $scMeta['tpg_taxonomy'] ) && ! empty( $scMeta['tpg_taxonomy'] ) ) {
|
198 |
+
foreach ( $scMeta['tpg_taxonomy'] as $taxonomy ) {
|
199 |
+
$terms = ( isset( $scMeta[ 'term_' . $taxonomy ] ) ? $scMeta[ 'term_' . $taxonomy ] : array() );
|
200 |
+
if ( is_array( $terms ) && ! empty( $terms ) ) {
|
201 |
+
$operator = ( isset( $scMeta[ 'term_operator_' . $taxonomy ][0] ) ? $scMeta[ 'term_operator_' . $taxonomy ][0] : "IN" );
|
202 |
+
$taxQ[] = array(
|
203 |
+
'taxonomy' => $taxonomy,
|
204 |
+
'field' => 'term_id',
|
205 |
+
'terms' => $terms,
|
206 |
+
'operator' => $operator,
|
207 |
+
);
|
208 |
+
if ( $taxonomy == $taxFilter ) {
|
209 |
+
$taxFilterOperator = $operator;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
if ( $taxonomy == $taxFilter ) {
|
213 |
+
$taxFilterTerms = $terms;
|
214 |
+
}
|
215 |
+
}
|
216 |
+
}
|
217 |
+
if ( count( $taxQ ) >= 2 ) {
|
218 |
+
$relation = ( isset( $scMeta['taxonomy_relation'][0] ) ? $scMeta['taxonomy_relation'][0] : "AND" );
|
219 |
+
$taxQ['relation'] = $relation;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
if ( ! empty( $taxQ ) ) {
|
224 |
+
$args['tax_query'] = $taxQ;
|
225 |
+
}
|
226 |
+
|
227 |
+
// Order
|
228 |
+
if ( in_array( 'order', $adv_filter ) ) {
|
229 |
+
$order_by = ( isset( $scMeta['order_by'][0] ) ? $scMeta['order_by'][0] : null );
|
230 |
+
$order = ( isset( $scMeta['order'][0] ) ? $scMeta['order'][0] : null );
|
231 |
+
if ( $order ) {
|
232 |
+
$args['order'] = $order;
|
233 |
+
}
|
234 |
+
if ( $order_by ) {
|
235 |
+
$args['orderby'] = $order_by;
|
236 |
+
$meta_key = ! empty( $scMeta['tpg_meta_key'][0] ) ? trim( $scMeta['tpg_meta_key'][0] ) : null;
|
237 |
+
if ( in_array( $order_by, array_keys( rtTPG()->rtMetaKeyType() ) ) && $meta_key ) {
|
238 |
+
$args['orderby'] = $order_by;
|
239 |
+
$args['meta_key'] = $meta_key;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
// Status
|
245 |
+
if ( in_array( 'tpg_post_status', $adv_filter ) ) {
|
246 |
+
$post_status = ( isset( $scMeta['tpg_post_status'] ) ? $scMeta['tpg_post_status'] : array() );
|
247 |
+
if ( ! empty( $post_status ) ) {
|
248 |
+
$args['post_status'] = $post_status;
|
249 |
+
}
|
250 |
+
} else {
|
251 |
+
$args['post_status'] = 'publish';
|
252 |
+
}
|
253 |
+
// Author
|
254 |
+
$author = ( isset( $scMeta['author'] ) ? $scMeta['author'] : array() );
|
255 |
+
$filterAuthors = array();
|
256 |
+
if ( in_array( 'author', $adv_filter ) && ! empty( $author ) ) {
|
257 |
+
$filterAuthors = $args['author__in'] = $author;
|
258 |
+
}
|
259 |
+
|
260 |
+
// Search
|
261 |
+
$s = ( isset( $scMeta['s'][0] ) ? $scMeta['s'][0] : array() );
|
262 |
+
if ( in_array( 's', $adv_filter ) && ! empty( $s ) ) {
|
263 |
+
$args['s'] = $s;
|
264 |
+
}
|
265 |
+
|
266 |
+
// Date query
|
267 |
+
if ( in_array( 'date_range', $adv_filter ) ) {
|
268 |
+
$startDate = ( ! empty( $scMeta['date_range_start'][0] ) ? $scMeta['date_range_start'][0] : null );
|
269 |
+
$endDate = ( ! empty( $scMeta['date_range_end'][0] ) ? $scMeta['date_range_end'][0] : null );
|
270 |
+
if ( $startDate && $endDate ) {
|
271 |
+
$args['date_query'] = array(
|
272 |
+
array(
|
273 |
+
'after' => $startDate,
|
274 |
+
'before' => $endDate,
|
275 |
+
'inclusive' => true,
|
276 |
+
),
|
277 |
+
);
|
278 |
+
}
|
279 |
+
}
|
280 |
+
|
281 |
+
$settings = get_option( rtTPG()->options['settings'] );
|
282 |
+
$oLayoutTag = ! empty( $settings['template_tag'] ) ? absint( $settings['template_tag'] ) : null;
|
283 |
+
$oLayoutAuthor = ! empty( $settings['template_author'] ) ? $settings['template_author'] : null;
|
284 |
+
$oLayoutCategory = ! empty( $settings['template_category'] ) ? $settings['template_category'] : null;
|
285 |
+
$oLayoutSearch = ! empty( $settings['template_search'] ) ? $settings['template_search'] : null;
|
286 |
+
$dataArchive = null;
|
287 |
+
if ( ( is_category() && $oLayoutCategory ) || ( is_search() && $oLayoutSearch ) || ( is_tag() && $oLayoutTag ) || ( is_author() && $oLayoutAuthor ) ) {
|
288 |
+
|
289 |
+
unset( $args['post_type'] );
|
290 |
+
unset( $args['tax_query'] );
|
291 |
+
unset( $args['author__in'] );
|
292 |
+
$obj = get_queried_object();
|
293 |
+
$aType = $aValue = null;
|
294 |
+
if ( $oLayoutTag && is_tag() ) {
|
295 |
+
if ( ! empty( $obj->slug ) ) {
|
296 |
+
$aValue = $args['tag'] = $obj->slug;
|
297 |
+
$aType = 'tag';
|
298 |
+
}
|
299 |
+
} else if ( $oLayoutCategory && is_category() ) {
|
300 |
+
if ( ! empty( $obj->slug ) ) {
|
301 |
+
$aValue = $args['category_name'] = $obj->slug;
|
302 |
+
}
|
303 |
+
$aType = 'category';
|
304 |
+
} else if ( $oLayoutAuthor && is_author() ) {
|
305 |
+
$aValue = $args['author'] = $obj->ID;
|
306 |
+
$aType = 'author';
|
307 |
+
} else if ( $oLayoutSearch && is_search() ) {
|
308 |
+
$aValue = $args['s'] = get_search_query();
|
309 |
+
$aType = 'search';
|
310 |
+
}
|
311 |
+
$dataArchive = " data-archive='{$aType}' data-archive-value='{$aValue}'";
|
312 |
+
$args['posts_per_archive_page'] = $args['posts_per_page'];
|
313 |
+
}
|
314 |
+
|
315 |
+
// Validation
|
316 |
+
$containerDataAttr = null;
|
317 |
+
$containerDataAttr .= " data-layout='{$layout}' data-desktop-col='{$dCol}' data-tab-col='{$tCol}' data-mobile-col='{$mCol}'";
|
318 |
+
|
319 |
+
$dCol = $dCol == 5 ? '24' : round( 12 / $dCol );
|
320 |
+
$tCol = $dCol == 5 ? '24' : round( 12 / $tCol );
|
321 |
+
$mCol = $dCol == 5 ? '24' : round( 12 / $mCol );
|
322 |
+
if ( $isCarousel ) {
|
323 |
+
$dCol = $tCol = $mCol = 12;
|
324 |
+
}
|
325 |
+
$arg['grid'] = "rt-col-md-{$dCol} rt-col-sm-{$tCol} rt-col-xs-{$mCol}";
|
326 |
+
if ( $layout == 'layout2' || $layout == 'layout3' ) {
|
327 |
+
$iCol = ( isset( $scMeta['tgp_layout2_image_column'][0] ) ? absint( $scMeta['tgp_layout2_image_column'][0] ) : 4 );
|
328 |
+
$iCol = $iCol > 12 ? 4 : $iCol;
|
329 |
+
$cCol = 12 - $iCol;
|
330 |
+
$arg['image_area'] = "rt-col-sm-{$iCol} rt-col-xs-12 ";
|
331 |
+
$arg['content_area'] = "rt-col-sm-{$cCol} rt-col-xs-12 ";
|
332 |
+
} else if ( $layout == 'layout4' ) {
|
333 |
+
$arg['image_area'] = "rt-col-md-6 rt-col-sm-12 rt-col-xs-12 ";
|
334 |
+
$arg['content_area'] = "rt-col-md-6 rt-col-sm-12 rt-col-xs-12 ";
|
335 |
+
}
|
336 |
+
$arg_class = [];
|
337 |
+
if ( ! $isIsotope && ! rtTPG()->hasPro() ) {
|
338 |
+
$arg_class[] = 'rt-equal-height';
|
339 |
+
}
|
340 |
+
$gridType = ! empty( $scMeta['grid_style'][0] ) ? $scMeta['grid_style'][0] : 'even';
|
341 |
+
if ( $isIsotope && ! rtTPG()->hasPro() ) {
|
342 |
+
$arg_class[] = "masonry-grid-item";
|
343 |
+
} else if ( ! $isCarousel && ! $isOffset ) {
|
344 |
+
$arg_class[] = $gridType . "-grid-item";
|
345 |
+
}
|
346 |
+
$arg_class[] = "rt-grid-item";
|
347 |
+
if ( $isOffset ) {
|
348 |
+
$arg_class[] = "rt-offset-item";
|
349 |
+
}
|
350 |
+
|
351 |
+
$masonryG = null;
|
352 |
+
if ( $gridType == "even" ) {
|
353 |
+
$masonryG = " tpg-even";
|
354 |
+
} else if ( $gridType == "masonry" && ! $isIsotope && ! $isCarousel ) {
|
355 |
+
$masonryG = " tpg-masonry";
|
356 |
+
}
|
357 |
+
$preLoader = $preLoaderHtml = null;
|
358 |
+
if ( $isIsotope ) {
|
359 |
+
$arg_class[] = 'isotope-item';
|
360 |
+
$preLoader = 'tpg-pre-loader';
|
361 |
+
}
|
362 |
+
if ( $isCarousel ) {
|
363 |
+
$arg_class[] = 'carousel-item';
|
364 |
+
$preLoader = 'tpg-pre-loader';
|
365 |
+
}
|
366 |
+
if ( $preLoader && rtTPG()->hasPro() ) {
|
367 |
+
$preLoaderHtml = '<div class="rt-loading-overlay"></div><div class="rt-loading rt-ball-clip-rotate"><div></div></div>';
|
368 |
+
}
|
369 |
+
|
370 |
+
$margin = ! empty( $scMeta['margin_option'][0] ) ? $scMeta['margin_option'][0] : 'default';
|
371 |
+
if ( $margin == 'no' ) {
|
372 |
+
$arg_class[] = 'no-margin';
|
373 |
+
}
|
374 |
+
if ( ! empty( $scMeta['tpg_image_type'][0] ) && $scMeta['tpg_image_type'][0] == 'circle' ) {
|
375 |
+
$arg_class[] = 'tpg-img-circle';
|
376 |
+
}
|
377 |
+
$arg['class'] = implode( " ", $arg_class );
|
378 |
+
$arg['anchorClass'] = $arg['link_target'] = null;
|
379 |
+
$link = ! empty( $scMeta['link_to_detail_page'][0] ) ? $scMeta['link_to_detail_page'][0] : 'yes';
|
380 |
+
if ( $link != 'yes' ) {
|
381 |
+
$arg['anchorClass'] = ' disabled';
|
382 |
+
}
|
383 |
+
$isSinglePopUp = false;
|
384 |
+
$linkType = ! empty( $scMeta['detail_page_link_type'][0] ) ? $scMeta['detail_page_link_type'][0] : 'popup';
|
385 |
+
if ( $link == 'yes' ) {
|
386 |
+
if ( $linkType == 'popup' && rtTPG()->hasPro() ) {
|
387 |
+
$popupType = ! empty( $scMeta['popup_type'][0] ) ? $scMeta['popup_type'][0] : 'single';
|
388 |
+
if ( $popupType == 'single' ) {
|
389 |
+
$arg['anchorClass'] .= ' tpg-single-popup';
|
390 |
+
$isSinglePopUp = true;
|
391 |
+
} else {
|
392 |
+
$arg['anchorClass'] .= ' tpg-multi-popup';
|
393 |
+
}
|
394 |
+
} else {
|
395 |
+
$arg['link_target'] = ! empty( $scMeta['link_target'][0] ) ? " target='{$scMeta['link_target'][0]}'" : null;
|
396 |
+
}
|
397 |
+
}
|
398 |
+
|
399 |
+
$parentClass = ( ! empty( $scMeta['parent_class'][0] ) ? trim( $scMeta['parent_class'][0] ) : null );
|
400 |
+
$defaultImgId = ( ! empty( $scMeta['default_preview_image'][0] ) ? absint( $scMeta['default_preview_image'][0] ) : null );
|
401 |
+
$customImgSize = ( ! empty( $scMeta['custom_image_size'] ) ? $scMeta['custom_image_size'] : array() );
|
402 |
+
|
403 |
+
$arg['scID'] = $scID;
|
404 |
+
$arg['items'] = isset( $scMeta['item_fields'] ) ? ( $scMeta['item_fields'] ? $scMeta['item_fields'] : array() ) : array();
|
405 |
+
if ( in_array( 'cf', $arg['items'] ) ) {
|
406 |
+
$arg['cf_group'] = array();
|
407 |
+
$arg['cf_group'] = get_post_meta( $scID, 'cf_group' );
|
408 |
+
$arg['format'] = array(
|
409 |
+
'hide_empty' => get_post_meta( $scID, 'cf_hide_empty_value', true ),
|
410 |
+
'show_value' => get_post_meta( $scID, 'cf_show_only_value', true ),
|
411 |
+
'hide_group_title' => get_post_meta( $scID, 'cf_hide_group_title', true )
|
412 |
+
);
|
413 |
+
}
|
414 |
+
|
415 |
+
// Set readmore false if excerpt type = full content
|
416 |
+
if ( isset( $arg['excerpt_type'] ) && $arg['excerpt_type'] === 'full' && ( $key = array_search( 'read_more', $arg['items'] ) ) !== false ) {
|
417 |
+
unset( $arg['items'][ $key ] );
|
418 |
+
}
|
419 |
+
|
420 |
+
if ( ! empty( $scMeta['ignore_sticky_posts'][0] ) ) {
|
421 |
+
$args['ignore_sticky_posts'] = true;
|
422 |
+
} else {
|
423 |
+
$args['wp_tpg_is_home'] = true;
|
424 |
+
}
|
425 |
+
|
426 |
+
$filters = ! empty( $scMeta['tgp_filter'] ) ? $scMeta['tgp_filter'] : array();
|
427 |
+
$action_term = ! empty( $scMeta['tgp_default_filter'][0] ) ? absint( $scMeta['tgp_default_filter'][0] ) : 0;
|
428 |
+
$hide_all_button = ! empty( $scMeta['tpg_hide_all_button'][0] ) ? true : false;
|
429 |
+
if ( $taxHierarchical ) {
|
430 |
+
$terms = rtTPG()->rt_get_all_term_by_taxonomy( $taxFilter, true, 0 );
|
431 |
+
} else {
|
432 |
+
$terms = rtTPG()->rt_get_all_term_by_taxonomy( $taxFilter, true );
|
433 |
+
}
|
434 |
+
if ( $hide_all_button && ! $action_term ) {
|
435 |
+
if ( ! empty( $terms ) ) {
|
436 |
+
$allKeys = array_keys( $terms );
|
437 |
+
$action_term = $allKeys[0];
|
438 |
+
}
|
439 |
+
}
|
440 |
+
if ( in_array( '_taxonomy_filter', $filters ) && $taxFilter && $action_term ) {
|
441 |
+
$args['tax_query'] = array(
|
442 |
+
array(
|
443 |
+
'taxonomy' => $taxFilter,
|
444 |
+
'field' => 'term_id',
|
445 |
+
'terms' => array( $action_term ),
|
446 |
+
)
|
447 |
+
);
|
448 |
+
}
|
449 |
+
|
450 |
+
if ( $limit != - 1 && $pagination ) {
|
451 |
+
$tempArgs = $args;
|
452 |
+
$tempArgs['posts_per_page'] = $limit;
|
453 |
+
$tempArgs['paged'] = 1;
|
454 |
+
$tempArgs['fields'] = 'ids';
|
455 |
+
$tempQ = new WP_Query( $tempArgs );
|
456 |
+
if ( ! empty( $tempQ->posts ) ) {
|
457 |
+
$args['post__in'] = $tempQ->posts;
|
458 |
+
}
|
459 |
+
}
|
460 |
+
|
461 |
+
$arg['title_tag'] = (!empty($scMeta['title_tag'][0]) && in_array($scMeta['title_tag'][0], array_keys(rtTPG()->getTitleTags()))) ? esc_attr($scMeta['title_tag'][0]) : 'h3';
|
462 |
+
|
463 |
+
$gridQuery = new WP_Query( apply_filters( 'tpg_sc_query_args', $args, $scMeta ) );
|
464 |
+
|
465 |
+
// Start layout
|
466 |
+
$html .= rtTPG()->layoutStyle( $layoutID, $scMeta, $layout, $scID );
|
467 |
+
$containerDataAttr .= " data-sc-id='{$scID}'";
|
468 |
+
$html .= "<div class='rt-container-fluid rt-tpg-container {$parentClass}' id='{$layoutID}' {$dataArchive} {$containerDataAttr}>";
|
469 |
+
if ( !$isCarousel && isset($settings['tpg_load_script']) && isset($settings['tpg_enable_preloader'])) {
|
470 |
+
$html .= '<div id="bottom-script-loader"><div class="rt-ball-clip-rotate"><div></div></div></div>';
|
471 |
+
}
|
472 |
+
if ( ! empty( $filters ) && ( $isGrid || $isOffset || $isWooCom || $isEdd ) ) {
|
473 |
+
$html .= "<div class='rt-layout-filter-container rt-clear'><div class='rt-filter-wrap'>";
|
474 |
+
$selectedSubTermsForButton = null;
|
475 |
+
$allText = apply_filters( 'tpg_filter_all_text', __( "All", "the-post-grid" ), $scMeta );
|
476 |
+
if ( in_array( '_taxonomy_filter', $filters ) && $taxFilter ) {
|
477 |
+
$filterType = ( ! empty( $scMeta['tgp_filter_type'][0] ) ? $scMeta['tgp_filter_type'][0] : null );
|
478 |
+
$post_count = ( ! empty( $scMeta['tpg_post_count'][0] ) ? $scMeta['tpg_post_count'][0] : null );
|
479 |
+
$postCountClass = ( $post_count ? " has-post-count" : null );
|
480 |
+
$allSelect = " selected";
|
481 |
+
$isTermSelected = false;
|
482 |
+
if ( $action_term && $taxFilter ) {
|
483 |
+
$isTermSelected = true;
|
484 |
+
$allSelect = null;
|
485 |
+
}
|
486 |
+
if ( ! $filterType || $filterType == 'dropdown' ) {
|
487 |
+
$html .= "<div class='rt-filter-item-wrap rt-tax-filter rt-filter-dropdown-wrap parent-dropdown-wrap{$postCountClass}' data-taxonomy='{$taxFilter}'>";
|
488 |
+
$termDefaultText = $allText;
|
489 |
+
$dataTerm = 'all';
|
490 |
+
$htmlButton = "";
|
491 |
+
$selectedSubTerms = null;
|
492 |
+
$pCount = 0;
|
493 |
+
if ( ! empty( $terms ) ) {
|
494 |
+
$i = 0;
|
495 |
+
foreach ( $terms as $id => $term ) {
|
496 |
+
$pCount = $pCount + $term['count'];
|
497 |
+
$sT = null;
|
498 |
+
if ( $taxHierarchical ) {
|
499 |
+
$subTerms = rtTPG()->rt_get_all_term_by_taxonomy( $taxFilter, true, $id );
|
500 |
+
if ( ! empty( $subTerms ) ) {
|
501 |
+
$count = 0;
|
502 |
+
$item = $allCount = null;
|
503 |
+
foreach ( $subTerms as $stId => $t ) {
|
504 |
+
$count = $count + absint( $t['count'] );
|
505 |
+
$sTPostCount = ( $post_count ? " (<span class='rt-post-count'>{$t['count']}</span>)" : null );
|
506 |
+
$item .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$stId}'><span class='rt-text'>{$t['name']}{$sTPostCount}</span></span>";
|
507 |
+
}
|
508 |
+
if ( $post_count ) {
|
509 |
+
$allCount = " (<span class='rt-post-count'>{$count}</span>)";
|
510 |
+
}
|
511 |
+
$sT .= "<div class='rt-filter-item-wrap rt-tax-filter rt-filter-dropdown-wrap sub-dropdown-wrap{$postCountClass}'>";
|
512 |
+
$sT .= "<span class='term-default rt-filter-dropdown-default' data-term='{$id}'>
|
513 |
+
<span class='rt-text'>" . $allText . "{$allCount}</span>
|
514 |
+
<i class='fa fa-angle-down rt-arrow-angle' aria-hidden='true'></i>
|
515 |
+
</span>";
|
516 |
+
$sT .= '<span class="term-dropdown rt-filter-dropdown">';
|
517 |
+
$sT .= $item;
|
518 |
+
$sT .= '</span>';
|
519 |
+
$sT .= "</div>";
|
520 |
+
}
|
521 |
+
if ( $action_term === $id ) {
|
522 |
+
$selectedSubTerms = $sT;
|
523 |
+
}
|
524 |
+
}
|
525 |
+
$postCount = ( $post_count ? " (<span class='rt-post-count'>{$term['count']}</span>)" : null );
|
526 |
+
if ( $action_term && $action_term == $id ) {
|
527 |
+
$termDefaultText = $term['name'] . $postCount;
|
528 |
+
$dataTerm = $id;
|
529 |
+
}
|
530 |
+
if ( is_array( $taxFilterTerms ) && ! empty( $taxFilterTerms ) ) {
|
531 |
+
if ( $taxFilterOperator == "NOT IN" ) {
|
532 |
+
if ( ! in_array( $id, $taxFilterTerms ) && $action_term != $id ) {
|
533 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$id}'><span class='rt-text'>{$term['name']}{$postCount}</span>{$sT}</span>";
|
534 |
+
}
|
535 |
+
} else {
|
536 |
+
if ( in_array( $id, $taxFilterTerms ) && $action_term != $id ) {
|
537 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$id}'><span class='rt-text'>{$term['name']}{$postCount}</span>{$sT}</span>";
|
538 |
+
}
|
539 |
+
}
|
540 |
+
} else {
|
541 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$id}'><span class='rt-text'>{$term['name']}{$postCount}</span>{$sT}</span>";
|
542 |
+
}
|
543 |
+
$i ++;
|
544 |
+
}
|
545 |
+
}
|
546 |
+
$pAllCount = null;
|
547 |
+
if ( $post_count ) {
|
548 |
+
$pAllCount = " (<span class='rt-post-count'>{$pCount}</span>)";
|
549 |
+
if ( ! $action_term ) {
|
550 |
+
$termDefaultText = $termDefaultText . $pAllCount;
|
551 |
+
}
|
552 |
+
}
|
553 |
+
if ( ! $hide_all_button ) {
|
554 |
+
$htmlButton = "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='all'><span class='rt-text'>" . $allText . "{$pAllCount}</span></span>" . $htmlButton;
|
555 |
+
}
|
556 |
+
$htmlButton = sprintf( '<span class="term-dropdown rt-filter-dropdown">%s</span>', $htmlButton );
|
557 |
+
|
558 |
+
$showAllhtml = '<span class="term-default rt-filter-dropdown-default" data-term="' . $dataTerm . '">
|
559 |
+
<span class="rt-text">' . $termDefaultText . '</span>
|
560 |
+
<i class="fa fa-angle-down rt-arrow-angle" aria-hidden="true"></i>
|
561 |
+
</span>';
|
562 |
+
|
563 |
+
$html .= $showAllhtml . $htmlButton;
|
564 |
+
$html .= '</div>' . $selectedSubTerms;
|
565 |
+
} else {
|
566 |
+
$termDefaultText = $allText;
|
567 |
+
$bCount = 0;
|
568 |
+
$bItems = null;
|
569 |
+
if ( ! empty( $terms ) ) {
|
570 |
+
foreach ( $terms as $id => $term ) {
|
571 |
+
$bCount = $bCount + absint( $term['count'] );
|
572 |
+
$sT = null;
|
573 |
+
if ( $taxHierarchical ) {
|
574 |
+
$subTerms = rtTPG()->rt_get_all_term_by_taxonomy( $taxFilter, true, $id );
|
575 |
+
if ( ! empty( $subTerms ) ) {
|
576 |
+
$sT .= "<div class='rt-filter-sub-tax sub-button-group'>";
|
577 |
+
foreach ( $subTerms as $stId => $t ) {
|
578 |
+
$sTPostCount = ( $post_count ? " (<span class='rt-post-count'>{$t['count']}</span>)" : null );
|
579 |
+
$sT .= "<span class='rt-filter-button-item' data-term='{$stId}'>{$t['name']}{$sTPostCount}</span>";
|
580 |
+
}
|
581 |
+
$sT .= "</div>";
|
582 |
+
if ( $action_term === $id ) {
|
583 |
+
$selectedSubTermsForButton = $sT;
|
584 |
+
}
|
585 |
+
}
|
586 |
+
}
|
587 |
+
$postCount = ( $post_count ? " (<span class='rt-post-count'>{$term['count']}</span>)" : null );
|
588 |
+
$termSelected = null;
|
589 |
+
if ( $isTermSelected && $id == $action_term ) {
|
590 |
+
$termSelected = " selected";
|
591 |
+
}
|
592 |
+
if ( is_array( $taxFilterTerms ) && ! empty( $taxFilterTerms ) ) {
|
593 |
+
if ( $taxFilterOperator == "NOT IN" ) {
|
594 |
+
if ( ! in_array( $id, $taxFilterTerms ) ) {
|
595 |
+
$bItems .= "<span class='term-button-item rt-filter-button-item {$termSelected}' data-term='{$id}'>{$term['name']}{$postCount}{$sT}</span>";
|
596 |
+
}
|
597 |
+
} else {
|
598 |
+
if ( in_array( $id, $taxFilterTerms ) ) {
|
599 |
+
$bItems .= "<span class='term-button-item rt-filter-button-item {$termSelected}' data-term='{$id}'>{$term['name']}{$postCount}{$sT}</span>";
|
600 |
+
}
|
601 |
+
}
|
602 |
+
|
603 |
+
} else {
|
604 |
+
$bItems .= "<span class='term-button-item rt-filter-button-item {$termSelected}' data-term='{$id}'>{$term['name']}{$postCount}{$sT}</span>";
|
605 |
+
}
|
606 |
+
}
|
607 |
+
}
|
608 |
+
$html .= "<div class='rt-filter-item-wrap rt-tax-filter rt-filter-button-wrap{$postCountClass}' data-taxonomy='{$taxFilter}'>";
|
609 |
+
if ( ! $hide_all_button ) {
|
610 |
+
$pCountH = ( $post_count ? " (<span class='rt-post-count'>{$bCount}</span>)" : null );
|
611 |
+
$html .= "<span class='term-button-item rt-filter-button-item {$allSelect}' data-term='all'>" . $allText . "{$pCountH}</span>";
|
612 |
+
}
|
613 |
+
$html .= $bItems;
|
614 |
+
$html .= "</div>";
|
615 |
+
}
|
616 |
+
}
|
617 |
+
|
618 |
+
// Author filter
|
619 |
+
if ( in_array( '_author_filter', $filters ) ) {
|
620 |
+
$filterType = ( ! empty( $scMeta['tgp_filter_type'][0] ) ? $scMeta['tgp_filter_type'][0] : null );
|
621 |
+
$post_count = ( ! empty( $scMeta['tpg_post_count'][0] ) ? $scMeta['tpg_post_count'][0] : null );
|
622 |
+
$users = get_users( apply_filters( 'tpg_author_arg', array() ) );
|
623 |
+
|
624 |
+
$allSelect = " selected";
|
625 |
+
$isTermSelected = false;
|
626 |
+
if ( $action_term && $taxFilter ) {
|
627 |
+
$isTermSelected = true;
|
628 |
+
$allSelect = null;
|
629 |
+
}
|
630 |
+
if ( ! $filterType || $filterType == 'dropdown' ) {
|
631 |
+
$html .= "<div class='rt-filter-item-wrap rt-author-filter rt-filter-dropdown-wrap parent-dropdown-wrap{$postCountClass}'>";
|
632 |
+
$termDefaultText = $allText;
|
633 |
+
$dataAuthor = 'all';
|
634 |
+
$htmlButton = "";
|
635 |
+
$htmlButton .= '<span class="author-dropdown rt-filter-dropdown">';
|
636 |
+
if ( ! empty( $users ) ) {
|
637 |
+
foreach ( $users as $user ) {
|
638 |
+
if ( is_array( $filterAuthors ) && ! empty( $filterAuthors ) ) {
|
639 |
+
if ( in_array( $user->ID, $filterAuthors ) ) {
|
640 |
+
if ( $action_term == $user->ID ) {
|
641 |
+
$termDefaultText = $user->display_name;
|
642 |
+
$dataTerm = $user->ID;
|
643 |
+
} else {
|
644 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$user->ID}'>{$user->display_name}</span>";
|
645 |
+
}
|
646 |
+
}
|
647 |
+
} else {
|
648 |
+
if ( $action_term == $user->ID ) {
|
649 |
+
$termDefaultText = $user->display_name;
|
650 |
+
$dataTerm = $user->ID;
|
651 |
+
} else {
|
652 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$user->ID}'>{$user->display_name}</span>";
|
653 |
+
}
|
654 |
+
}
|
655 |
+
}
|
656 |
+
}
|
657 |
+
|
658 |
+
if ( $isTermSelected ) {
|
659 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='all'>" . $allText . "{$pAllCount}</span>";
|
660 |
+
}
|
661 |
+
$htmlButton .= '</span>';
|
662 |
+
|
663 |
+
$showAllhtml = '<span class="term-default rt-filter-dropdown-default" data-term="' . $dataAuthor . '">
|
664 |
+
<span class="rt-text">' . $termDefaultText . '</span>
|
665 |
+
<i class="fa fa-angle-down rt-arrow-angle" aria-hidden="true"></i>
|
666 |
+
</span>';
|
667 |
+
|
668 |
+
$html .= $showAllhtml . $htmlButton;
|
669 |
+
$html .= '</div>';
|
670 |
+
} else {
|
671 |
+
$bCount = 0;
|
672 |
+
$bItems = null;
|
673 |
+
if ( ! empty( $users ) ) {
|
674 |
+
foreach ( $users as $user ) {
|
675 |
+
if ( is_array( $filterAuthors ) && ! empty( $filterAuthors ) ) {
|
676 |
+
if ( in_array( $user->ID, $filterAuthors ) ) {
|
677 |
+
$bItems .= "<span class='author-button-item rt-filter-button-item data-author='{$user->ID}'>{$user->display_name}</span>";
|
678 |
+
}
|
679 |
+
} else {
|
680 |
+
$bItems .= "<span class='author-button-item rt-filter-button-item data-author='{$user->ID}'>{$user->display_name}</span>";
|
681 |
+
}
|
682 |
+
}
|
683 |
+
}
|
684 |
+
$html .= "<div class='rt-filter-item-wrap rt-author-filter rt-filter-button-wrap{$postCountClass}' data-taxonomy='{$taxFilter}'>";
|
685 |
+
if ( ! $hide_all_button ) {
|
686 |
+
$pCountH = ( $post_count ? " (<span class='rt-post-count'>{$bCount}</span>)" : null );
|
687 |
+
$html .= "<span class='author-button-item rt-filter-button-item {$allSelect}' data-author='all'>" . $allText . "{$pCountH}</span>";
|
688 |
+
}
|
689 |
+
$html .= $bItems;
|
690 |
+
$html .= "</div>";
|
691 |
+
}
|
692 |
+
}
|
693 |
+
|
694 |
+
if ( in_array( '_sort_order', $filters ) ) {
|
695 |
+
$action_order = ( ! empty( $args['order'] ) ? strtoupper( trim( $args['order'] ) ) : "DESC" );
|
696 |
+
$html .= '<div class="rt-filter-item-wrap rt-sort-order-action">';
|
697 |
+
$html .= "<span class='rt-sort-order-action-arrow' data-sort-order='{$action_order}'> <span></span></span>";
|
698 |
+
$html .= '</div>';
|
699 |
+
}
|
700 |
+
|
701 |
+
if ( in_array( '_order_by', $filters ) ) {
|
702 |
+
$wooFeature = ( $postType == "product" ? true : false );
|
703 |
+
$orders = rtTPG()->rtPostOrderBy( $wooFeature );
|
704 |
+
$action_orderby = ( ! empty( $args['orderby'] ) ? trim( $args['orderby'] ) : "none" );
|
705 |
+
if ( $action_orderby == 'none' ) {
|
706 |
+
$action_orderby_label = __( "Sort By None", "the-post-grid" );
|
707 |
+
} elseif ( in_array( $action_orderby, array_keys( rtTPG()->rtMetaKeyType() ) ) ) {
|
708 |
+
$action_orderby_label = __( "Meta value", "the-post-grid" );
|
709 |
+
} else {
|
710 |
+
$action_orderby_label = $orders[ $action_orderby ];
|
711 |
+
}
|
712 |
+
if ( $action_orderby !== 'none' ) {
|
713 |
+
$orders['none'] = __( "Sort By None", "the-post-grid" );
|
714 |
+
}
|
715 |
+
$html .= '<div class="rt-filter-item-wrap rt-order-by-action rt-filter-dropdown-wrap">';
|
716 |
+
$html .= "<span class='order-by-default rt-filter-dropdown-default' data-order-by='{$action_orderby}'>
|
717 |
+
<span class='rt-text-order-by'>{$action_orderby_label}</span>
|
718 |
+
<i class='fa fa-angle-down rt-arrow-angle' aria-hidden='true'></i>
|
719 |
+
</span>";
|
720 |
+
$html .= '<span class="order-by-dropdown rt-filter-dropdown">';
|
721 |
+
|
722 |
+
foreach ( $orders as $orderKey => $order ) {
|
723 |
+
$html .= '<span class="order-by-dropdown-item rt-filter-dropdown-item" data-order-by="' . $orderKey . '">' . $order . '</span>';
|
724 |
+
}
|
725 |
+
$html .= '</span>';
|
726 |
+
$html .= '</div>';
|
727 |
+
}
|
728 |
+
|
729 |
+
if ( in_array( '_search', $filters ) ) {
|
730 |
+
$html .= '<div class="rt-filter-item-wrap rt-search-filter-wrap">';
|
731 |
+
$html .= sprintf( '<input type="text" class="rt-search-input" placeholder="%s">', esc_html__( "Search...", 'the-post-grid' ) );
|
732 |
+
$html .= "<span class='rt-action'>🔍</span>";
|
733 |
+
$html .= "<span class='rt-loading'></span>";
|
734 |
+
$html .= '</div>';
|
735 |
+
}
|
736 |
+
$html .= "</div>$selectedSubTermsForButton</div>";
|
737 |
+
}
|
738 |
+
|
739 |
+
$html .= "<div data-title='" . __( "Loading ...",
|
740 |
+
'the-post-grid' ) . "' class='rt-row rt-content-loader {$layout}{$masonryG} {$preLoader}'>";
|
741 |
+
|
742 |
+
if ( $gridQuery->have_posts() ) {
|
743 |
+
|
744 |
+
if ( $isCarousel ) {
|
745 |
+
$cOpt = ! empty( $scMeta['carousel_property'] ) ? $scMeta['carousel_property'] : array();
|
746 |
+
$slider_js_options = apply_filters( 'rttpg_slider_js_options', array(
|
747 |
+
"speed" => ! empty( $scMeta['tpg_carousel_speed'][0] ) ? absint( $scMeta['tpg_carousel_speed'][0] ) : 250,
|
748 |
+
"autoPlayTimeOut" => ! empty( $scMeta['tpg_carousel_autoplay_timeout'][0] ) ? absint( $scMeta['tpg_carousel_autoplay_timeout'][0] ) : 5000,
|
749 |
+
"autoPlay" => in_array( 'auto_play', $cOpt ),
|
750 |
+
"stopOnHover" => in_array( 'stop_hover', $cOpt ),
|
751 |
+
"nav" => in_array( 'nav_button', $cOpt ),
|
752 |
+
"dots" => in_array( 'pagination', $cOpt ),
|
753 |
+
"loop" => in_array( 'loop', $cOpt ),
|
754 |
+
"lazyLoad" => in_array( 'lazyLoad', $cOpt ),
|
755 |
+
"autoHeight" => in_array( 'autoHeight', $cOpt ),
|
756 |
+
"rtl" => in_array( 'rtl', $cOpt )
|
757 |
+
), $scMeta );
|
758 |
+
$html .= sprintf( '<div class="rt-carousel-holder" data-rtowl-options="%s">',
|
759 |
+
htmlspecialchars( wp_json_encode( $slider_js_options ) ) );
|
760 |
+
}
|
761 |
+
$isotope_filter = null;
|
762 |
+
if ( $isIsotope ) {
|
763 |
+
$isotope_filter = isset( $scMeta['isotope_filter'][0] ) ? $scMeta['isotope_filter'][0] : null;
|
764 |
+
$isotope_dropdown_filter = isset( $scMeta['isotope_filter_dropdown'][0] ) ? $scMeta['isotope_filter_dropdown'][0] : null;
|
765 |
+
$selectedTerms = array();
|
766 |
+
if ( isset( $scMeta['post_filter'] ) && in_array( 'tpg_taxonomy',
|
767 |
+
$scMeta['post_filter'] ) && isset( $scMeta['tpg_taxonomy'] ) && in_array( $isotope_filter,
|
768 |
+
$scMeta['tpg_taxonomy'] )
|
769 |
+
) {
|
770 |
+
$selectedTerms = ( isset( $scMeta[ 'term_' . $isotope_filter ] ) ? $scMeta[ 'term_' . $isotope_filter ] : array() );
|
771 |
+
}
|
772 |
+
$termArgs = [
|
773 |
+
'taxonomy' => $isotope_filter,
|
774 |
+
'orderby' => 'meta_value_num',
|
775 |
+
'order' => 'ASC',
|
776 |
+
'hide_empty' => false,
|
777 |
+
'include' => $selectedTerms
|
778 |
+
];
|
779 |
+
if ( rtTPG()->hasPro() ) {
|
780 |
+
$termArgs['meta_key'] = '_rt_order';
|
781 |
+
}
|
782 |
+
$terms = get_terms( $termArgs );
|
783 |
+
|
784 |
+
$html .= '<div class="tpg-iso-filter">';
|
785 |
+
$htmlButton = $drop = null;
|
786 |
+
$fSelectTrigger = false;
|
787 |
+
|
788 |
+
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
|
789 |
+
foreach ( $terms as $term ) {
|
790 |
+
$tItem = ! empty( $scMeta['isotope_default_filter'][0] ) ? $scMeta['isotope_default_filter'][0] : null;
|
791 |
+
$fSelected = null;
|
792 |
+
if ( $tItem == $term->term_id ) {
|
793 |
+
$fSelected = 'selected';
|
794 |
+
$fSelectTrigger = true;
|
795 |
+
}
|
796 |
+
$htmlButton .= sprintf( '<button class="rt-iso-btn-%s%s" data-filter=".iso_%d">%s</button>',
|
797 |
+
esc_attr( $term->slug ),
|
798 |
+
$fSelected ? " " . $fSelected : '',
|
799 |
+
$term->term_id,
|
800 |
+
$term->name
|
801 |
+
);
|
802 |
+
$drop .= "<option value='.iso_{$term->term_id}' {$fSelected}>{$term->name}</option>";
|
803 |
+
}
|
804 |
+
}
|
805 |
+
if ( empty( $scMeta['isotope_filter_show_all'][0] ) ) {
|
806 |
+
$fSelect = ( $fSelectTrigger ? null : 'class="selected"' );
|
807 |
+
$htmlButton = "<button class='rt-iso-btn-all selected' data-filter='*'>" . $arg['show_all_text'] . "</button>" . $htmlButton;
|
808 |
+
$drop = "<option value='*' {$fSelect}>{$arg['show_all_text']}</option>" . $drop;
|
809 |
+
}
|
810 |
+
$filter_count = ! empty( $scMeta['isotope_filter_count'][0] ) ? true : false;
|
811 |
+
$filter_url = ! empty( $scMeta['isotope_filter_url'][0] ) ? true : false;
|
812 |
+
$htmlButton = "<div id='iso-button-{$rand}' class='rt-tpg-isotope-buttons button-group filter-button-group option-set' data-url='{$filter_url}' data-count='{$filter_count}'>{$htmlButton}</div>";
|
813 |
+
|
814 |
+
if ( $isotope_dropdown_filter ) {
|
815 |
+
$html .= "<select class='isotope-dropdown-filter'>{$drop}</select>";
|
816 |
+
} else {
|
817 |
+
$html .= $htmlButton;
|
818 |
+
}
|
819 |
+
if ( ! empty( $scMeta['isotope_search_filter'][0] ) ) {
|
820 |
+
$html .= "<div class='iso-search'><input type='text' class='iso-search-input' placeholder='" . __( 'Search',
|
821 |
+
'the-post-grid' ) . "' /></div>";
|
822 |
+
}
|
823 |
+
$html .= '</div>';
|
824 |
+
|
825 |
+
$html .= "<div class='rt-tpg-isotope' id='iso-tpg-{$rand}'>";
|
826 |
+
}
|
827 |
+
|
828 |
+
$l = $offLoop = 0;
|
829 |
+
$offsetBigHtml = $offsetSmallHtml = null;
|
830 |
+
|
831 |
+
while ( $gridQuery->have_posts() ) : $gridQuery->the_post();
|
832 |
+
if ( $colStore == $l ) {
|
833 |
+
if ( $this->l4toggle ) {
|
834 |
+
$this->l4toggle = false;
|
835 |
+
} else {
|
836 |
+
$this->l4toggle = true;
|
837 |
+
}
|
838 |
+
$l = 0;
|
839 |
+
}
|
840 |
+
$pID = get_the_ID();
|
841 |
+
$arg['pID'] = $pID;
|
842 |
+
$arg['title'] = rtTPG()->get_the_title( $pID, $arg );
|
843 |
+
$arg['pLink'] = get_permalink();
|
844 |
+
$arg['toggle'] = $this->l4toggle;
|
845 |
+
$arg['layoutID'] = $layoutID;
|
846 |
+
$arg['author'] = apply_filters( 'rttpg_author_link', sprintf( '<a href="%s">%s</a>', get_author_posts_url( get_the_author_meta( 'ID' ) ), get_the_author() ) );
|
847 |
+
$cc = wp_count_comments( $pID );
|
848 |
+
$arg['date'] = get_the_date();
|
849 |
+
$arg['excerpt'] = rtTPG()->get_the_excerpt( $pID, $arg );
|
850 |
+
$arg['categories'] = get_the_term_list( $pID, 'category', null, '<span class="rt-separator">,</span>' );
|
851 |
+
$arg['tags'] = get_the_term_list( $pID, 'post_tag', null, '<span class="rt-separator">,</span>' );
|
852 |
+
if ( $isIsotope ) {
|
853 |
+
$termAs = wp_get_post_terms( $pID, $isotope_filter, array( "fields" => "all" ) );
|
854 |
+
$isoFilter = [];
|
855 |
+
if ( ! empty( $termAs ) ) {
|
856 |
+
foreach ( $termAs as $term ) {
|
857 |
+
$isoFilter[] = "iso_" . $term->term_id;
|
858 |
+
$isoFilter[] = "rt-item-" . esc_attr( $term->slug );
|
859 |
+
}
|
860 |
+
}
|
861 |
+
$arg['isoFilter'] = ! empty( $isoFilter ) ? implode( " ", $isoFilter ) : '';
|
862 |
+
}
|
863 |
+
if ( comments_open() ) {
|
864 |
+
$arg['comment'] = "<a href='" . get_comments_link( $pID ) . "'>{$cc->total_comments} </a>";
|
865 |
+
} else {
|
866 |
+
$arg['comment'] = "{$cc->total_comments}";
|
867 |
+
}
|
868 |
+
$imgSrc = null;
|
869 |
+
|
870 |
+
if ( $isOffset ) {
|
871 |
+
if ( $offLoop == 0 ) {
|
872 |
+
$arg['imgSrc'] = ! $fImg ? rtTPG()->getFeatureImageSrc( $pID, $fImgSize, $mediaSource,
|
873 |
+
$defaultImgId,
|
874 |
+
$customImgSize ) : null;
|
875 |
+
$arg['offset'] = 'big';
|
876 |
+
$offsetBigHtml = rtTPG()->render( 'layouts/' . $layout, $arg, true );
|
877 |
+
} else {
|
878 |
+
$arg['offset'] = 'small';
|
879 |
+
$arg['offsetCol'] = array( $dCol, $tCol, $mCol );
|
880 |
+
$arg['imgSrc'] = ! $fImg ? rtTPG()->getFeatureImageSrc( $pID, 'thumbnail',
|
881 |
+
$mediaSource,
|
882 |
+
$defaultImgId,
|
883 |
+
$customImgSize ) : null;
|
884 |
+
$offsetSmallHtml .= rtTPG()->render( 'layouts/' . $layout, $arg, true );
|
885 |
+
}
|
886 |
+
} else {
|
887 |
+
$arg['imgSrc'] = ! $fImg ? rtTPG()->getFeatureImageSrc( $pID, $fImgSize, $mediaSource,
|
888 |
+
$defaultImgId,
|
889 |
+
$customImgSize ) : null;
|
890 |
+
$html .= rtTPG()->render( 'layouts/' . $layout, $arg, true );
|
891 |
+
}
|
892 |
+
$offLoop ++;
|
893 |
+
$l ++;
|
894 |
+
endwhile;
|
895 |
+
if ( $isOffset ) {
|
896 |
+
$oDCol = rtTPG()->get_offset_col( $dCol );
|
897 |
+
$oTCol = rtTPG()->get_offset_col( $tCol );
|
898 |
+
$oMCol = rtTPG()->get_offset_col( $mCol );
|
899 |
+
if ( $layout == "offset03" || $layout == "offset04" ) {
|
900 |
+
$oDCol['big'] = $oTCol['big'] = $oDCol['small'] = $oTCol['small'] = 6;
|
901 |
+
$oMCol['big'] = $oMCol['small'] = 12;
|
902 |
+
}
|
903 |
+
$html .= "<div class='rt-col-md-{$oDCol['big']} rt-col-sm-{$oTCol['big']} rt-col-xs-{$oMCol['big']}'><div class='rt-row'>{$offsetBigHtml}</div></div>";
|
904 |
+
$html .= "<div class='rt-col-md-{$oDCol['small']} rt-col-sm-{$oTCol['small']} rt-col-xs-{$oMCol['small']}'><div class='rt-row offset-small-wrap'>{$offsetSmallHtml}</div></div>";
|
905 |
+
}
|
906 |
+
if ( $isIsotope || $isCarousel ) {
|
907 |
+
$html .= '</div>'; // End isotope / Carousel item holder
|
908 |
+
}
|
909 |
+
|
910 |
+
} else {
|
911 |
+
$not_found_text = isset( $scMeta['tgp_not_found_text'][0] ) && ! empty( $scMeta['tgp_not_found_text'][0] ) ? esc_attr( $scMeta['tgp_not_found_text'][0] ) : __( 'No post found', 'the-post-grid' );
|
912 |
+
$html .= sprintf( '<p>%s</p>',
|
913 |
+
apply_filters( 'tpg_not_found_text', $not_found_text, $args, $scMeta )
|
914 |
+
);
|
915 |
+
}
|
916 |
+
$html .= $preLoaderHtml;
|
917 |
+
$html .= "</div>"; // End row
|
918 |
+
$htmlUtility = null;
|
919 |
+
if ( $pagination && ! $isCarousel ) {
|
920 |
+
if ( $isOffset ) {
|
921 |
+
$posts_loading_type = "page_prev_next";
|
922 |
+
$htmlUtility .= "<div class='rt-cb-page-prev-next'>
|
923 |
+
<span class='rt-cb-prev-btn'><i class='fa fa-angle-left' aria-hidden='true'></i></span>
|
924 |
+
<span class='rt-cb-next-btn'><i class='fa fa-angle-right' aria-hidden='true'></i></span>
|
925 |
+
</div>";
|
926 |
+
} else {
|
927 |
+
$hide = ( $gridQuery->max_num_pages < 2 ? " rt-hidden-elm" : null );
|
928 |
+
if ( $posts_loading_type == "pagination" ) {
|
929 |
+
if ( $isGrid && empty( $filters ) ) {
|
930 |
+
$htmlUtility .= rtTPG()->rt_pagination( $gridQuery,
|
931 |
+
$args['posts_per_page'] );
|
932 |
+
}
|
933 |
+
} elseif ( $posts_loading_type == "pagination_ajax" && ! $isIsotope ) {
|
934 |
+
$htmlUtility .= "<div class='rt-page-numbers'></div>";
|
935 |
+
} elseif ( $posts_loading_type == "load_more" && rtTPG()->hasPro() ) {
|
936 |
+
$htmlUtility .= "<div class='rt-loadmore-btn rt-loadmore-action rt-loadmore-style{$hide}'>
|
937 |
+
<span class='rt-loadmore-text'>" . __( 'Load More', 'the-post-grid' ) . "</span>
|
938 |
+
<div class='rt-loadmore-loading rt-ball-scale-multiple rt-2x'><div></div><div></div><div></div></div>
|
939 |
+
</div>";
|
940 |
+
|
941 |
+
} elseif ( $posts_loading_type == "load_on_scroll" && rtTPG()->hasPro() ) {
|
942 |
+
$htmlUtility .= "<div class='rt-infinite-action'>
|
943 |
+
<div class='rt-infinite-loading la-fire la-2x'>
|
944 |
+
<div></div>
|
945 |
+
<div></div>
|
946 |
+
<div></div>
|
947 |
+
</div>
|
948 |
+
</div>";
|
949 |
+
}
|
950 |
+
}
|
951 |
+
}
|
952 |
+
|
953 |
+
if ( $htmlUtility ) {
|
954 |
+
$l4toggle = null;
|
955 |
+
if ( $layout == "layout4" ) {
|
956 |
+
$l4toggle = "data-l4toggle='{$this->l4toggle}'";
|
957 |
+
}
|
958 |
+
$html .= "<div class='rt-pagination-wrap' data-total-pages='{$gridQuery->max_num_pages}' data-posts-per-page='{$args['posts_per_page']}' data-type='{$posts_loading_type}' {$l4toggle} >" . $htmlUtility . "</div>";
|
959 |
+
}
|
960 |
+
|
961 |
+
$html .= "</div>"; // container rt-tpg
|
962 |
+
|
963 |
+
wp_reset_postdata();
|
964 |
+
|
965 |
+
$scriptGenerator = array();
|
966 |
+
$scriptGenerator['layout'] = $layoutID;
|
967 |
+
$scriptGenerator['rand'] = $rand;
|
968 |
+
$scriptGenerator['scMeta'] = $scMeta;
|
969 |
+
$scriptGenerator['isCarousel'] = $isCarousel;
|
970 |
+
$scriptGenerator['isSinglePopUp'] = $isSinglePopUp;
|
971 |
+
$scriptGenerator['isWooCom'] = $isWooCom;
|
972 |
+
$this->scA[] = $scriptGenerator;
|
973 |
+
add_action( 'wp_footer', array( $this, 'register_sc_scripts' ) );
|
974 |
+
} else {
|
975 |
+
$html .= "<p>" . __( "No shortCode found", "the-post-grid" ) . "</p>";
|
976 |
+
}
|
977 |
+
|
978 |
+
//restriction issue
|
979 |
+
$restriction = ( ! empty( $scMeta['restriction_user_role'] ) ? $scMeta['restriction_user_role'] : array() );
|
980 |
+
if ( ! empty( $restriction ) ) {
|
981 |
+
if ( is_user_logged_in() ) {
|
982 |
+
$currentUserRoles = rtTPG()->getCurrentUserRoles();
|
983 |
+
if ( in_array( 'administrator', $currentUserRoles ) ) {
|
984 |
+
$html = $html;
|
985 |
+
} else {
|
986 |
+
if ( count( array_intersect( $restriction, $currentUserRoles ) ) ) {
|
987 |
+
$html = $html;
|
988 |
+
} else {
|
989 |
+
$html = "<p>" . __( "You are not permitted to view this content.",
|
990 |
+
"the-post-grid" ) . "</p>";
|
991 |
+
}
|
992 |
+
}
|
993 |
+
|
994 |
+
} else {
|
995 |
+
$html = "<p>" . __( "This is a restricted content, you need to logged in to view this content.",
|
996 |
+
"the-post-grid" ) . "</p>";
|
997 |
+
}
|
998 |
+
}
|
999 |
+
|
1000 |
+
return $html;
|
1001 |
+
}
|
1002 |
+
|
1003 |
+
public function order_by_popularity_post_clauses( $args ) {
|
1004 |
+
global $wpdb;
|
1005 |
+
$args['orderby'] = "$wpdb->postmeta.meta_value+0 DESC, $wpdb->posts.post_date DESC";
|
1006 |
+
|
1007 |
+
return $args;
|
1008 |
+
}
|
1009 |
+
}
|
1010 |
+
endif;
|
lib/models/rtTPGField.php
CHANGED
@@ -107,6 +107,10 @@ if ( ! class_exists( 'rtTPGField' ) ):
|
|
107 |
$html .= $this->checkbox();
|
108 |
break;
|
109 |
|
|
|
|
|
|
|
|
|
110 |
case 'radio':
|
111 |
$html .= $this->radioField();
|
112 |
break;
|
@@ -327,6 +331,14 @@ if ( ! class_exists( 'rtTPGField' ) ):
|
|
327 |
return $h;
|
328 |
}
|
329 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
private function radioField() {
|
331 |
$holderClass = explode(' ', $this->holderClass);
|
332 |
$atts = (in_array('pro-field', $holderClass)) && !rtTPG()->hasPro() ? 'disabled="true"' : '';
|
107 |
$html .= $this->checkbox();
|
108 |
break;
|
109 |
|
110 |
+
case 'switch':
|
111 |
+
$html .= $this->switchField();
|
112 |
+
break;
|
113 |
+
|
114 |
case 'radio':
|
115 |
$html .= $this->radioField();
|
116 |
break;
|
331 |
return $h;
|
332 |
}
|
333 |
|
334 |
+
private function switchField() {
|
335 |
+
$h = null;
|
336 |
+
$checked = ( $this->value ? "checked" : null );
|
337 |
+
$h .= "<label class='rttm-switch'><input type='checkbox' {$checked} id='{$this->id}' name='{$this->name}' value='1' /><span class='rttm-switch-slider round'></span></label>";
|
338 |
+
|
339 |
+
return $h;
|
340 |
+
}
|
341 |
+
|
342 |
private function radioField() {
|
343 |
$holderClass = explode(' ', $this->holderClass);
|
344 |
$atts = (in_array('pro-field', $holderClass)) && !rtTPG()->hasPro() ? 'disabled="true"' : '';
|
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: 3.0.
|
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: 3.0.4
|
8 |
* Text Domain: the-post-grid
|
9 |
* Domain Path: /languages
|
10 |
* Author URI: https://radiustheme.com/
|