Version Description
- Documentation update
Download this release
Release Info
Developer | techlabpro1 |
Plugin | The Post Grid |
Version | 2.3.3 |
Comparing to | |
See all releases |
Code changes from version 2.3.2 to 2.3.3
- README.txt +5 -2
- assets/css/admin.css +384 -148
- assets/css/thepostgrid.css +14 -8
- assets/images/rt-tpg-menu.png +0 -0
- assets/images/rt-tpg-sc.png +0 -0
- assets/images/rt-tpg_18.png +0 -0
- assets/images/rt-tpg_32.png +0 -0
- assets/js/admin.js +155 -145
- languages/the-post-grid.pot +93 -43
- lib/classes/rtTPGAjaxResponse.php +143 -142
- lib/classes/rtTPGHelper.php +334 -355
- lib/classes/rtTPGMeta.php +50 -17
- lib/classes/rtTPGOptions.php +481 -438
- lib/classes/rtTPGShortCode.php +470 -464
- lib/models/rtTPGField.php +78 -88
- lib/views/layouts/isotope1.php +34 -12
- lib/views/layouts/layout1.php +28 -9
- lib/views/layouts/layout2.php +34 -11
- lib/views/layouts/layout3.php +33 -11
- lib/views/settings/post-source.php +175 -175
- lib/views/settings/settings.php +14 -27
- the-post-grid.php +1 -1
README.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: post grid, content grid, post display, post format, post view, blog display, news display, post
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.3
|
7 |
-
Stable tag: 2.3.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -16,7 +16,7 @@ Fast & Easy way to display WordPress post in Grid, List & Isotope view ( filter
|
|
16 |
|
17 |
The Post Grid is a fully Responsive & Mobile friendly plugin to display your page/post in Grid, List and Isotope View without any line of coding. It is fast and easy to generate grid from admin end and insert into page/post. You can Display posts by any category(s), tag(s), author(s), keyword(s) also Order posts by Id, Title, Created date, Modified date and Menu order.
|
18 |
|
19 |
-
[youtube https://www.youtube.com/watch?v=
|
20 |
|
21 |
By using The Post Grid plugin you can display your post in Grid List & Isotope view in minutes, without any line of Coding...
|
22 |
|
@@ -139,6 +139,9 @@ For any bug or suggestion please mail support@radiustheme.com
|
|
139 |
|
140 |
== Changelog ==
|
141 |
|
|
|
|
|
|
|
142 |
= 2.3.2 =
|
143 |
* Full Content view
|
144 |
|
4 |
Tags: post grid, content grid, post display, post format, post view, blog display, news display, post
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.3
|
7 |
+
Stable tag: 2.3.3
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
16 |
|
17 |
The Post Grid is a fully Responsive & Mobile friendly plugin to display your page/post in Grid, List and Isotope View without any line of coding. It is fast and easy to generate grid from admin end and insert into page/post. You can Display posts by any category(s), tag(s), author(s), keyword(s) also Order posts by Id, Title, Created date, Modified date and Menu order.
|
18 |
|
19 |
+
[youtube https://www.youtube.com/watch?v=6ivjE8qc0Mw]
|
20 |
|
21 |
By using The Post Grid plugin you can display your post in Grid List & Isotope view in minutes, without any line of Coding...
|
22 |
|
139 |
|
140 |
== Changelog ==
|
141 |
|
142 |
+
= 2.3.3 =
|
143 |
+
* Documentation update
|
144 |
+
|
145 |
= 2.3.2 =
|
146 |
* Full Content view
|
147 |
|
assets/css/admin.css
CHANGED
@@ -1,258 +1,494 @@
|
|
1 |
-
/*
|
2 |
-
.
|
|
|
|
|
3 |
display: none;
|
4 |
}
|
5 |
|
6 |
-
.
|
7 |
-
|
8 |
-
padding: 11px;
|
9 |
}
|
10 |
|
11 |
-
|
|
|
12 |
display: none;
|
13 |
}
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
color: #
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
display: block;
|
25 |
-
text-align: center;
|
26 |
}
|
27 |
|
28 |
-
|
29 |
-
|
|
|
|
|
30 |
}
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
35 |
padding: 0;
|
36 |
-
display:
|
37 |
-
|
38 |
-
margin
|
39 |
}
|
40 |
|
41 |
-
|
42 |
-
background: none repeat scroll 0 0 rgb(230, 230, 230);
|
43 |
cursor: pointer;
|
44 |
display: inline-block;
|
45 |
-
|
46 |
-
margin: 0;
|
47 |
}
|
48 |
|
49 |
-
|
50 |
-
|
51 |
}
|
52 |
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
height:
|
60 |
-
|
61 |
-
|
62 |
-
border-
|
63 |
position: absolute;
|
64 |
-
|
65 |
left: 0;
|
66 |
right: 0;
|
67 |
-
|
68 |
-
|
69 |
-
content: "";
|
70 |
}
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
color: #fff;
|
79 |
-
position: relative;
|
80 |
}
|
81 |
|
82 |
-
|
|
|
|
|
|
|
|
|
83 |
border-right: 0;
|
84 |
}
|
85 |
|
86 |
-
|
87 |
-
-webkit-box-shadow: none;
|
88 |
box-shadow: none;
|
89 |
}
|
90 |
|
91 |
-
|
|
|
|
|
|
|
|
|
92 |
display: none;
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
|
96 |
-
.rt-
|
97 |
-
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
-
.
|
102 |
width: 100%;
|
|
|
103 |
}
|
104 |
|
105 |
-
.rt-
|
106 |
-
|
|
|
107 |
}
|
108 |
|
109 |
-
.
|
110 |
-
|
111 |
}
|
112 |
|
113 |
-
.
|
114 |
-
border: 1px solid #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
}
|
116 |
|
117 |
-
.
|
118 |
-
|
|
|
|
|
119 |
}
|
120 |
|
121 |
-
.
|
122 |
-
|
123 |
}
|
124 |
|
125 |
-
.rt-
|
126 |
-
|
127 |
}
|
128 |
|
129 |
-
.rt-
|
130 |
-
|
131 |
}
|
132 |
|
133 |
-
|
134 |
-
|
|
|
|
|
135 |
}
|
136 |
|
137 |
-
.rt-
|
138 |
-
|
139 |
-
color: #fff;
|
140 |
}
|
141 |
|
142 |
-
.rt-
|
143 |
-
|
144 |
}
|
145 |
|
146 |
-
.rt-
|
147 |
-
|
148 |
-
|
149 |
-
width: 25%;
|
150 |
}
|
151 |
|
152 |
-
.rt-
|
153 |
-
|
154 |
-
width: 75%;
|
155 |
}
|
156 |
|
157 |
-
.rt-
|
158 |
-
|
159 |
-
content: ".";
|
160 |
-
visibility: hidden;
|
161 |
-
display: block;
|
162 |
-
height: 0;
|
163 |
}
|
164 |
|
165 |
-
.rt-
|
166 |
-
|
167 |
}
|
168 |
|
169 |
-
.rt-
|
170 |
-
|
171 |
-
|
172 |
}
|
173 |
|
174 |
-
.field-
|
175 |
-
|
|
|
176 |
}
|
177 |
|
178 |
-
.
|
179 |
display: block;
|
180 |
margin-bottom: 5px;
|
181 |
}
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
input.large-text.code.rt-code-sc {
|
184 |
color: #fff;
|
185 |
-
background: #
|
186 |
font-weight: bold;
|
187 |
-
padding-top: 3px;
|
188 |
}
|
189 |
|
190 |
-
.rt-
|
191 |
-
|
192 |
-
height: 150px;
|
193 |
}
|
194 |
|
195 |
-
.rt-
|
196 |
-
border:
|
197 |
-
-moz-border-radius: 3px;
|
198 |
-
-webkit-border-radius: 3px;
|
199 |
-
border-radius: 3px;
|
200 |
-
width: 100%;
|
201 |
-
max-width: 800px;
|
202 |
-
height: 200px;
|
203 |
-
position: relative;
|
204 |
}
|
205 |
|
206 |
-
|
207 |
-
|
|
|
|
|
|
|
|
|
|
|
208 |
background: #fff;
|
209 |
-
padding:
|
210 |
}
|
211 |
|
212 |
-
.rt-
|
213 |
-
|
214 |
}
|
215 |
|
216 |
-
.rt-
|
217 |
-
|
218 |
-
padding-bottom: 5px;
|
219 |
}
|
220 |
|
221 |
-
.
|
222 |
-
|
223 |
-
float: left;
|
224 |
}
|
225 |
|
226 |
-
.
|
227 |
-
|
228 |
-
color: #fff;
|
229 |
-
padding: 30px;
|
230 |
-
width: 90%;
|
231 |
}
|
232 |
|
233 |
-
.
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
border-bottom: 1px solid #fff;
|
238 |
}
|
239 |
|
240 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
color: #fff;
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
margin-top: 5px;
|
246 |
}
|
247 |
|
248 |
-
.
|
249 |
-
|
250 |
-
text-decoration: underline;
|
251 |
}
|
252 |
|
253 |
-
|
254 |
-
.
|
255 |
-
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
}
|
258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ============== MetaBox START ============== */
|
2 |
+
.post-type-rttpg #misc-publishing-actions,
|
3 |
+
.post-type-rttpg #submitdiv > .handlediv,
|
4 |
+
.post-type-rttpg #submitdiv h2 {
|
5 |
display: none;
|
6 |
}
|
7 |
|
8 |
+
.post-type-rttpg #minor-publishing-actions {
|
9 |
+
padding: 0;
|
|
|
10 |
}
|
11 |
|
12 |
+
#rt_plugin_sc_pro_information button.handlediv,
|
13 |
+
#rt_plugin_sc_pro_information h2.hndle {
|
14 |
display: none;
|
15 |
}
|
16 |
|
17 |
+
#rttpg_meta h2.hndle {
|
18 |
+
font-size: 18px;
|
19 |
+
color: #000000;
|
20 |
+
background-color: #ffffff;
|
21 |
+
border-radius: 4px;
|
22 |
+
padding: 20px;
|
23 |
+
margin-bottom: 20px;
|
24 |
}
|
25 |
|
26 |
+
#rttpg_meta,
|
27 |
+
#rt_plugin_sc_pro_information {
|
28 |
+
background: transparent;
|
29 |
+
border: 0;
|
|
|
|
|
30 |
}
|
31 |
|
32 |
+
#rttpg_meta .inside,
|
33 |
+
#rt_plugin_sc_pro_information .inside {
|
34 |
+
padding: 0;
|
35 |
+
margin: 0;
|
36 |
}
|
37 |
|
38 |
+
/* ============== MetaBox END ================ */
|
39 |
+
|
40 |
+
/* ============== Nav style START ============== */
|
41 |
+
ul.rt-tab-nav {
|
42 |
padding: 0;
|
43 |
+
display: flex;
|
44 |
+
border-bottom: 1px solid #dee2e6;
|
45 |
+
margin: 0;
|
46 |
}
|
47 |
|
48 |
+
ul.rt-tab-nav li {
|
|
|
49 |
cursor: pointer;
|
50 |
display: inline-block;
|
51 |
+
margin-bottom: -1px;
|
|
|
52 |
}
|
53 |
|
54 |
+
ul.rt-tab-nav li + li {
|
55 |
+
margin-left: 2px;
|
56 |
}
|
57 |
|
58 |
+
ul.rt-tab-nav li a {
|
59 |
+
position: relative;
|
60 |
+
font-size: 15px;
|
61 |
+
color: #ffffff;
|
62 |
+
background-color: #ffffff;
|
63 |
+
padding: 10px 25px;
|
64 |
+
border-radius: 4px 4px 0 0;
|
65 |
+
display: inline-block;
|
66 |
+
text-decoration: none;
|
67 |
+
z-index: 2;
|
68 |
+
transition: all 0.3s ease-in-out;
|
69 |
+
}
|
70 |
+
|
71 |
+
ul.rt-tab-nav li:focus {
|
72 |
+
outline: none;
|
73 |
}
|
74 |
|
75 |
+
ul.rt-tab-nav li a:after {
|
76 |
+
content: "";
|
77 |
+
height: 100%;
|
78 |
+
width: 100%;
|
79 |
+
background-color: #5d3dfd;
|
80 |
+
border-radius: 4px 4px 0 0;
|
81 |
position: absolute;
|
82 |
+
top: 0;
|
83 |
left: 0;
|
84 |
right: 0;
|
85 |
+
z-index: -1;
|
86 |
+
transition: all 0.3s ease-in-out;
|
|
|
87 |
}
|
88 |
|
89 |
+
ul.rt-tab-nav li.active a {
|
90 |
+
color: #5d3dfd;
|
91 |
+
}
|
92 |
+
|
93 |
+
ul.rt-tab-nav li.active a:after {
|
94 |
+
height: 10%;
|
|
|
|
|
95 |
}
|
96 |
|
97 |
+
ul.rt-tab-nav li a i {
|
98 |
+
margin-right: 10px;
|
99 |
+
}
|
100 |
+
|
101 |
+
ul.rt-tab-nav li:last-child a {
|
102 |
border-right: 0;
|
103 |
}
|
104 |
|
105 |
+
ul.rt-tab-nav li a:focus {
|
|
|
106 |
box-shadow: none;
|
107 |
}
|
108 |
|
109 |
+
/* ============== Nav style END ================ */
|
110 |
+
|
111 |
+
|
112 |
+
/* ============== Container START ============== */
|
113 |
+
.rt-tab-content {
|
114 |
display: none;
|
115 |
+
background: #fff;
|
116 |
+
}
|
117 |
+
|
118 |
+
.rt-field-wrapper {
|
119 |
+
border-bottom: 1px solid #e7e7e7;
|
120 |
+
padding: 10px 0;
|
121 |
+
display: flex;
|
122 |
}
|
123 |
|
124 |
+
.rt-label {
|
125 |
+
font-weight: bold;
|
126 |
+
flex: 0 0 200px;
|
127 |
+
padding: 15px 10px 15px 15px;
|
128 |
+
}
|
129 |
+
|
130 |
+
.rt-field {
|
131 |
+
flex: 1;
|
132 |
+
padding: 15px 15px 15px 10px;
|
133 |
+
max-width: 800px;
|
134 |
}
|
135 |
|
136 |
+
.rt-field textarea.rt-textarea {
|
137 |
width: 100%;
|
138 |
+
height: 80px;
|
139 |
}
|
140 |
|
141 |
+
.rt-field .rt-form-control {
|
142 |
+
width: 100%;
|
143 |
+
max-width: 100%;
|
144 |
}
|
145 |
|
146 |
+
.rt-field .rt-form-control[type="number"] {
|
147 |
+
width: 70px;
|
148 |
}
|
149 |
|
150 |
+
.rt-field-wrapper .custom-css {
|
151 |
+
border: 1px solid #dfdfdf;
|
152 |
+
-moz-border-radius: 3px;
|
153 |
+
-webkit-border-radius: 3px;
|
154 |
+
border-radius: 3px;
|
155 |
+
width: 100%;
|
156 |
+
max-width: 800px;
|
157 |
+
height: 200px;
|
158 |
+
position: relative;
|
159 |
}
|
160 |
|
161 |
+
.rt-field-wrapper .checkbox-group.vertical > label,
|
162 |
+
.rt-field-wrapper .radio-group.vertical > label {
|
163 |
+
display: block;
|
164 |
+
margin-bottom: 5px;
|
165 |
}
|
166 |
|
167 |
+
.rt-field-wrapper .checkbox-group > label {
|
168 |
+
margin-right: 15px;
|
169 |
}
|
170 |
|
171 |
+
.rt-field-wrapper .rt-select {
|
172 |
+
min-width: 300px;
|
173 |
}
|
174 |
|
175 |
+
.rt-field-wrapper .select2-container {
|
176 |
+
width: 100% !important;
|
177 |
}
|
178 |
|
179 |
+
|
180 |
+
.rt-field-wrapper .wp-picker-container .iris-picker {
|
181 |
+
position: absolute;
|
182 |
+
z-index: 999;
|
183 |
}
|
184 |
|
185 |
+
.rt-field-wrapper .wp-picker-container.wp-picker-active {
|
186 |
+
width: 265px;
|
|
|
187 |
}
|
188 |
|
189 |
+
.rt-field-wrapper > .rt-field > .field-item > .wp-picker-container > a {
|
190 |
+
margin: 0;
|
191 |
}
|
192 |
|
193 |
+
.rt-multiple-field-container {
|
194 |
+
display: flex;
|
195 |
+
flex-wrap: wrap;
|
|
|
196 |
}
|
197 |
|
198 |
+
.rt-multiple-field-container .rt-inner-field.rt-col-3 {
|
199 |
+
flex: 33.33333333%;
|
|
|
200 |
}
|
201 |
|
202 |
+
.rt-multiple-field-container .rt-inner-field.rt-col-4 {
|
203 |
+
flex: 25%;
|
|
|
|
|
|
|
|
|
204 |
}
|
205 |
|
206 |
+
.rt-multiple-field-container .rt-inner-field.rt-col-3 {
|
207 |
+
width: 33.33333333%;
|
208 |
}
|
209 |
|
210 |
+
.rt-multiple-field-container .rt-inner-field {
|
211 |
+
padding: 0 5px;
|
212 |
+
margin-bottom: 15px;
|
213 |
}
|
214 |
|
215 |
+
.rt-multiple-field-container .rt-inner-field label {
|
216 |
+
display: block;
|
217 |
+
margin-bottom: 5px;
|
218 |
}
|
219 |
|
220 |
+
.rt-inner-field-container .label {
|
221 |
display: block;
|
222 |
margin-bottom: 5px;
|
223 |
}
|
224 |
|
225 |
+
.rt-field-wrapper[style*='display: block'] {
|
226 |
+
display: flex !important;
|
227 |
+
}
|
228 |
+
|
229 |
+
/* ============== Container END ================ */
|
230 |
+
/* ============== Pro Feature START ============== */
|
231 |
+
|
232 |
+
body .rt-admin-btn,
|
233 |
+
body .rt-admin-btn.button-primary {
|
234 |
+
text-align: center;
|
235 |
+
display: inline-block;
|
236 |
+
font-size: 15px;
|
237 |
+
font-weight: 400;
|
238 |
+
color: #5d3dfd;
|
239 |
+
text-decoration: none;
|
240 |
+
padding: 9px 18px;
|
241 |
+
border-radius: 4px;
|
242 |
+
position: relative;
|
243 |
+
z-index: 2;
|
244 |
+
line-height: 1.4;
|
245 |
+
transition: all 0.3s ease-in-out;
|
246 |
+
height: auto;
|
247 |
+
border: 2px solid #5d3dfd;
|
248 |
+
}
|
249 |
+
|
250 |
+
body .rt-admin-btn.button-primary,
|
251 |
+
body .rt-admin-btn:hover {
|
252 |
+
background-color: #4e35cc;
|
253 |
+
color: #ffffff;
|
254 |
+
text-decoration: none;
|
255 |
+
}
|
256 |
+
|
257 |
+
.rt-document-box.rt-update-pro-btn-wrap {
|
258 |
+
padding: 0;
|
259 |
+
}
|
260 |
+
|
261 |
+
.rt-update-pro-btn-wrap {
|
262 |
+
margin-bottom: 30px;
|
263 |
+
}
|
264 |
+
|
265 |
+
.rt-update-pro-btn-wrap .rt-update-pro-btn {
|
266 |
+
text-align: center;
|
267 |
+
background-color: #5d3dfd;
|
268 |
+
display: block;
|
269 |
+
font-size: 16px;
|
270 |
+
font-weight: 600;
|
271 |
+
color: #ffffff;
|
272 |
+
text-decoration: none;
|
273 |
+
padding: 20px 30px;
|
274 |
+
border-radius: 4px;
|
275 |
+
transition: all 0.3s ease-in-out;
|
276 |
+
}
|
277 |
+
|
278 |
+
.rt-document-box {
|
279 |
+
background-color: #ffffff;
|
280 |
+
-webkit-box-shadow: 0 1px 18px 0 rgba(0, 0, 0, 0.08);
|
281 |
+
box-shadow: 0 1px 18px 0 rgba(0, 0, 0, 0.08);
|
282 |
+
border-radius: 4px;
|
283 |
+
padding: 30px 20px;
|
284 |
+
display: flex;
|
285 |
+
}
|
286 |
+
|
287 |
+
.rt-document-box ol {
|
288 |
+
margin-left: 1em;
|
289 |
+
}
|
290 |
+
|
291 |
+
.rt-document-box + .rt-document-box {
|
292 |
+
margin-top: 30px;
|
293 |
+
}
|
294 |
+
|
295 |
+
.rt-document-box .rt-box-icon {
|
296 |
+
height: 30px;
|
297 |
+
width: 30px;
|
298 |
+
background-color: #ecf1ff;
|
299 |
+
border-radius: 50%;
|
300 |
+
display: flex;
|
301 |
+
align-items: center;
|
302 |
+
justify-content: center;
|
303 |
+
align-content: center;
|
304 |
+
margin-right: 10px;
|
305 |
+
}
|
306 |
+
|
307 |
+
.rt-document-box .rt-box-icon i {
|
308 |
+
font-size: 20px;
|
309 |
+
color: #5d3dfd;
|
310 |
+
}
|
311 |
+
|
312 |
+
.rt-document-box .rt-box-content {
|
313 |
+
-webkit-box-flex: 1;
|
314 |
+
-ms-flex: 1;
|
315 |
+
flex: 1;
|
316 |
+
}
|
317 |
+
|
318 |
+
.rt-document-box .rt-box-content .rt-box-title {
|
319 |
+
margin: 0 0 12px 0;
|
320 |
+
font-size: 20px;
|
321 |
+
color: #000000;
|
322 |
+
font-weight: 600;
|
323 |
+
}
|
324 |
+
|
325 |
+
.rt-document-box .rt-box-content p {
|
326 |
+
font-size: 14px;
|
327 |
+
color: #646464;
|
328 |
+
margin: 0 0 25px 0;
|
329 |
+
}
|
330 |
+
|
331 |
+
.rt-update-pro-btn-wrap .rt-update-pro-btn:hover {
|
332 |
+
background-color: #4e35cc;
|
333 |
+
text-decoration: none;
|
334 |
+
color: #ffffff;
|
335 |
+
}
|
336 |
+
|
337 |
+
.rt-pro-feature-content .rt-update-pro-btn {
|
338 |
+
display: block;
|
339 |
+
width: 100%;
|
340 |
+
}
|
341 |
+
|
342 |
+
.rt-setting-title h3 {
|
343 |
+
font-size: 18px;
|
344 |
+
color: #000000;
|
345 |
+
background-color: #ffffff;
|
346 |
+
border-radius: 4px;
|
347 |
+
padding: 20px;
|
348 |
+
margin-bottom: 20px;
|
349 |
+
}
|
350 |
+
|
351 |
+
.rt-pro-feature-content {
|
352 |
+
display: flex;
|
353 |
+
}
|
354 |
+
|
355 |
+
.rt-settings-container .rt-document-box + .rt-document-box {
|
356 |
+
margin-top: 0;
|
357 |
+
margin-left: 30px;
|
358 |
+
}
|
359 |
+
|
360 |
+
.rt-settings-container .rt-pro-feature-content .rt-update-pro-btn {
|
361 |
+
display: flex;
|
362 |
+
justify-content: center;
|
363 |
+
align-items: center;
|
364 |
+
}
|
365 |
+
|
366 |
+
.rt-settings-container .rt-response {
|
367 |
+
display: none;
|
368 |
+
background: #fff;
|
369 |
+
border: 1px solid #ccd0d4;
|
370 |
+
border-left-width: 4px;
|
371 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
|
372 |
+
margin: 10px 0;
|
373 |
+
padding: 10px 12px;
|
374 |
+
}
|
375 |
+
|
376 |
+
/* ============== Pro Feature END ================ */
|
377 |
+
/************************** Others START **************************/
|
378 |
+
|
379 |
input.large-text.code.rt-code-sc {
|
380 |
color: #fff;
|
381 |
+
background: #5d3dfd;
|
382 |
font-weight: bold;
|
|
|
383 |
}
|
384 |
|
385 |
+
.rt-response.success {
|
386 |
+
border-left-color: #46b450;
|
|
|
387 |
}
|
388 |
|
389 |
+
.rt-response.error {
|
390 |
+
border-left-color: #dc3232;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
}
|
392 |
|
393 |
+
|
394 |
+
/*Product Listing*/
|
395 |
+
.rt-product-list {
|
396 |
+
display: grid;
|
397 |
+
grid-template-columns: repeat(auto-fill, minmax(400px, 400px));
|
398 |
+
grid-column-gap: 25px;
|
399 |
+
grid-row-gap: 25px;
|
400 |
background: #fff;
|
401 |
+
padding: 15px;
|
402 |
}
|
403 |
|
404 |
+
.rt-product-list .rt-product {
|
405 |
+
border: 1px solid #dcdada;
|
406 |
}
|
407 |
|
408 |
+
.rt-product-list .rt-product .rt-media img {
|
409 |
+
max-width: 100%;
|
|
|
410 |
}
|
411 |
|
412 |
+
.rt-product-list .rt-product .rt-product-info {
|
413 |
+
padding: 15px;
|
|
|
414 |
}
|
415 |
|
416 |
+
.rt-product-list .rt-product .rt-product-info h3.rt-product-title {
|
417 |
+
margin: 0 0 15px 0 !important;
|
|
|
|
|
|
|
418 |
}
|
419 |
|
420 |
+
.rt-product-list .rt-product .rt-product-info .rt-product-action {
|
421 |
+
display: grid;
|
422 |
+
grid-template-columns: auto auto;
|
423 |
+
grid-gap: 10px;
|
|
|
424 |
}
|
425 |
|
426 |
+
.rt-product-list .rt-product .rt-product-info .rt-product-action a {
|
427 |
+
text-align: center;
|
428 |
+
}
|
429 |
+
|
430 |
+
/* Extra */
|
431 |
+
.rt-tpg-filter-holder > h3 {
|
432 |
+
background: #5d3dfd;
|
433 |
color: #fff;
|
434 |
+
text-align: center;
|
435 |
+
margin: 0;
|
436 |
+
padding: .3em 0;
|
|
|
437 |
}
|
438 |
|
439 |
+
.tpg-hidden {
|
440 |
+
display: none;
|
|
|
441 |
}
|
442 |
|
443 |
+
.rt-loading {
|
444 |
+
background: url('../images/loading.gif') no-repeat center center;
|
445 |
+
padding: 11px;
|
446 |
+
}
|
447 |
+
|
448 |
+
/************************** Others END ****************************/
|
449 |
+
|
450 |
+
|
451 |
+
/* ------------------------------------------------------------------------- *
|
452 |
+
* Media Query
|
453 |
+
/* ------------------------------------------------------------------------- */
|
454 |
+
@media (max-width: 1199px) {
|
455 |
+
.rt-update-pro-btn-wrap .rt-update-pro-btn {
|
456 |
+
font-size: 20px;
|
457 |
+
}
|
458 |
+
}
|
459 |
+
|
460 |
+
@media (max-width: 767px) {
|
461 |
+
.rt-update-pro-btn-wrap .rt-update-pro-btn {
|
462 |
+
font-size: 18px;
|
463 |
+
}
|
464 |
+
|
465 |
+
.rt-pro-feature-content {
|
466 |
+
flex-direction: column;
|
467 |
+
}
|
468 |
+
|
469 |
+
.rt-settings-container .rt-document-box + .rt-document-box {
|
470 |
+
margin-top: 30px;
|
471 |
+
margin-left: 0;
|
472 |
+
}
|
473 |
+
}
|
474 |
+
|
475 |
+
@media (max-width: 479px) {
|
476 |
+
.rt-update-pro-btn-wrap .rt-update-pro-btn {
|
477 |
+
font-size: 16px;
|
478 |
+
}
|
479 |
+
|
480 |
+
.rt-field-wrapper {
|
481 |
+
flex-direction: column;
|
482 |
+
padding: 10px;
|
483 |
}
|
484 |
+
|
485 |
+
.rt-label {
|
486 |
+
flex: 1;
|
487 |
+
padding: 0;
|
488 |
+
margin-bottom: 10px;
|
489 |
+
}
|
490 |
+
|
491 |
+
.rt-field {
|
492 |
+
padding: 0;
|
493 |
+
}
|
494 |
+
}
|
assets/css/thepostgrid.css
CHANGED
@@ -164,6 +164,15 @@
|
|
164 |
padding-right: 0;
|
165 |
}
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
/**********************************************************************/
|
168 |
/********************************* Layout 1 *************************/
|
169 |
/**********************************************************************/
|
@@ -230,7 +239,7 @@
|
|
230 |
|
231 |
#poststuff .rt-tpg-container .layout1 .rt-holder .rt-detail h2,
|
232 |
#poststuff .rt-tpg-container .layout1 .rt-holder .rt-detail h3,
|
233 |
-
#poststuff .rt-tpg-container .layout1 .rt-holder .rt-detail h4
|
234 |
.rt-tpg-container .layout1 .rt-holder .rt-detail h2,
|
235 |
.rt-tpg-container .layout1 .rt-holder .rt-detail h3,
|
236 |
.rt-tpg-container .layout1 .rt-holder .rt-detail h4 {
|
@@ -267,7 +276,6 @@
|
|
267 |
}
|
268 |
|
269 |
.rt-tpg-container .layout1 .rt-holder .rt-detail .read-more a {
|
270 |
-
padding: 6px 12px;
|
271 |
border-radius: 5px;
|
272 |
-moz-border-radius: 5px;
|
273 |
-webkit-border-radius: 5px;
|
@@ -372,7 +380,6 @@
|
|
372 |
|
373 |
.rt-tpg-container .layout2 .rt-holder .rt-detail .read-more a {
|
374 |
display: inline-block;
|
375 |
-
padding: 6px 12px;
|
376 |
border-radius: 5px;
|
377 |
-moz-border-radius: 5px;
|
378 |
-webkit-border-radius: 5px;
|
@@ -400,7 +407,7 @@
|
|
400 |
.rt-tpg-container .layout3 .rt-holder .rt-detail h4 {
|
401 |
font-size: 26px;
|
402 |
margin: 0 0 14px 0;
|
403 |
-
padding:
|
404 |
font-weight: 400;
|
405 |
line-height: 1.25;
|
406 |
}
|
@@ -462,12 +469,12 @@
|
|
462 |
}
|
463 |
|
464 |
.rt-tpg-container .layout3 .rt-holder .rt-detail .read-more a {
|
465 |
-
padding: 6px 12px;
|
466 |
border-radius: 5px;
|
467 |
-moz-border-radius: 5px;
|
468 |
-webkit-border-radius: 5px;
|
469 |
background: #337ab7;
|
470 |
font-size: 15px;
|
|
|
471 |
}
|
472 |
|
473 |
.rt-tpg-container .layout3 .rt-holder .rt-img-holder > a img.rounded,
|
@@ -580,7 +587,6 @@
|
|
580 |
}
|
581 |
|
582 |
.rt-tpg-container .isotope1 .rt-holder .rt-detail .read-more a {
|
583 |
-
padding: 6px 12px;
|
584 |
border-radius: 5px;
|
585 |
-moz-border-radius: 5px;
|
586 |
-webkit-border-radius: 5px;
|
@@ -591,7 +597,7 @@
|
|
591 |
/* isotope Buttons */
|
592 |
.rt-tpg-container .rt-tpg-isotope-buttons {
|
593 |
text-align: center;
|
594 |
-
margin: 15px 0;
|
595 |
}
|
596 |
|
597 |
.rt-tpg-container .rt-tpg-isotope-buttons .selected {
|
@@ -601,7 +607,7 @@
|
|
601 |
.rt-tpg-container .rt-tpg-isotope-buttons button {
|
602 |
border: none;
|
603 |
margin: 4px;
|
604 |
-
padding:
|
605 |
outline: 0;
|
606 |
text-transform: none;
|
607 |
font-weight: 400;
|
164 |
padding-right: 0;
|
165 |
}
|
166 |
|
167 |
+
.rt-detail .post-content {
|
168 |
+
margin-bottom: 10px;
|
169 |
+
}
|
170 |
+
|
171 |
+
.rt-detail .read-more a {
|
172 |
+
padding: 8px 15px;
|
173 |
+
display: inline-block;
|
174 |
+
}
|
175 |
+
|
176 |
/**********************************************************************/
|
177 |
/********************************* Layout 1 *************************/
|
178 |
/**********************************************************************/
|
239 |
|
240 |
#poststuff .rt-tpg-container .layout1 .rt-holder .rt-detail h2,
|
241 |
#poststuff .rt-tpg-container .layout1 .rt-holder .rt-detail h3,
|
242 |
+
#poststuff .rt-tpg-container .layout1 .rt-holder .rt-detail h4,
|
243 |
.rt-tpg-container .layout1 .rt-holder .rt-detail h2,
|
244 |
.rt-tpg-container .layout1 .rt-holder .rt-detail h3,
|
245 |
.rt-tpg-container .layout1 .rt-holder .rt-detail h4 {
|
276 |
}
|
277 |
|
278 |
.rt-tpg-container .layout1 .rt-holder .rt-detail .read-more a {
|
|
|
279 |
border-radius: 5px;
|
280 |
-moz-border-radius: 5px;
|
281 |
-webkit-border-radius: 5px;
|
380 |
|
381 |
.rt-tpg-container .layout2 .rt-holder .rt-detail .read-more a {
|
382 |
display: inline-block;
|
|
|
383 |
border-radius: 5px;
|
384 |
-moz-border-radius: 5px;
|
385 |
-webkit-border-radius: 5px;
|
407 |
.rt-tpg-container .layout3 .rt-holder .rt-detail h4 {
|
408 |
font-size: 26px;
|
409 |
margin: 0 0 14px 0;
|
410 |
+
padding: 0;
|
411 |
font-weight: 400;
|
412 |
line-height: 1.25;
|
413 |
}
|
469 |
}
|
470 |
|
471 |
.rt-tpg-container .layout3 .rt-holder .rt-detail .read-more a {
|
|
|
472 |
border-radius: 5px;
|
473 |
-moz-border-radius: 5px;
|
474 |
-webkit-border-radius: 5px;
|
475 |
background: #337ab7;
|
476 |
font-size: 15px;
|
477 |
+
display: inline-block;
|
478 |
}
|
479 |
|
480 |
.rt-tpg-container .layout3 .rt-holder .rt-img-holder > a img.rounded,
|
587 |
}
|
588 |
|
589 |
.rt-tpg-container .isotope1 .rt-holder .rt-detail .read-more a {
|
|
|
590 |
border-radius: 5px;
|
591 |
-moz-border-radius: 5px;
|
592 |
-webkit-border-radius: 5px;
|
597 |
/* isotope Buttons */
|
598 |
.rt-tpg-container .rt-tpg-isotope-buttons {
|
599 |
text-align: center;
|
600 |
+
margin: 15px 0 30px 0;
|
601 |
}
|
602 |
|
603 |
.rt-tpg-container .rt-tpg-isotope-buttons .selected {
|
607 |
.rt-tpg-container .rt-tpg-isotope-buttons button {
|
608 |
border: none;
|
609 |
margin: 4px;
|
610 |
+
padding: 8px 15px;
|
611 |
outline: 0;
|
612 |
text-transform: none;
|
613 |
font-weight: 400;
|
assets/images/rt-tpg-menu.png
CHANGED
Binary file
|
assets/images/rt-tpg-sc.png
CHANGED
Binary file
|
assets/images/rt-tpg_18.png
CHANGED
Binary file
|
assets/images/rt-tpg_32.png
CHANGED
Binary file
|
assets/js/admin.js
CHANGED
@@ -1,24 +1,39 @@
|
|
1 |
(function ($) {
|
2 |
'use strict';
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
-
if ($.fn.select2) {
|
9 |
$(".rt-select2").select2({dropdownAutoWidth: true});
|
10 |
}
|
|
|
11 |
var postType = jQuery("#rc-sc-post-type").val();
|
12 |
rtTgpFilter();
|
|
|
13 |
thpShowHideScMeta();
|
14 |
renderTpgPreview();
|
15 |
-
$("#rttpg_meta")
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
22 |
var cOptions = {
|
23 |
defaultColor: false,
|
24 |
change: function (event, ui) {
|
@@ -30,17 +45,18 @@
|
|
30 |
hide: true,
|
31 |
palettes: true
|
32 |
};
|
33 |
-
|
34 |
}
|
|
|
35 |
$(document).on('change', '#post_filter input[type=checkbox]', function () {
|
36 |
var id = $(this).val();
|
37 |
-
if (id
|
38 |
if (this.checked) {
|
39 |
rtTPGTaxonomyListByPostType(postType, $(this));
|
40 |
} else {
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
}
|
45 |
}
|
46 |
if (this.checked) {
|
@@ -58,17 +74,17 @@
|
|
58 |
|
59 |
$(document).on('change', "#rt-tpg-pagination", function () {
|
60 |
if (this.checked) {
|
61 |
-
|
62 |
} else {
|
63 |
-
|
64 |
}
|
65 |
});
|
66 |
|
67 |
$(document).on('change', "#rt-feature-image", function () {
|
68 |
if (this.checked) {
|
69 |
-
|
70 |
} else {
|
71 |
-
|
72 |
}
|
73 |
});
|
74 |
|
@@ -86,10 +102,23 @@
|
|
86 |
$(".rt-tpg-filter.taxonomy > .taxonomy-field").html('');
|
87 |
$(".rt-tpg-filter.taxonomy > .rt-tpg-filter-item .term-filter-item-container").remove();
|
88 |
$(".rt-tpg-filter.hidden").hide();
|
89 |
-
$(".field-
|
90 |
}
|
91 |
});
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
function renderTpgPreview() {
|
95 |
if ($("#rttpg_meta").length) {
|
@@ -129,7 +158,7 @@
|
|
129 |
data: data,
|
130 |
beforeSend: function () {
|
131 |
if (element) {
|
132 |
-
$("<span class='rt-loading'
|
133 |
}
|
134 |
},
|
135 |
success: function (data) {
|
@@ -141,156 +170,137 @@
|
|
141 |
});
|
142 |
}
|
143 |
|
144 |
-
})(jQuery);
|
145 |
|
146 |
-
function rtTPGTaxonomyListByPostType(postType, $this) {
|
147 |
|
148 |
-
|
149 |
-
|
150 |
-
//console.log(data);
|
151 |
-
if (data.error) {
|
152 |
-
alert(data.msg);
|
153 |
-
} else {
|
154 |
-
jQuery('.rt-tpg-filter.taxonomy > .taxonomy-field').html(data.data).show('slow');
|
155 |
-
}
|
156 |
-
});
|
157 |
-
}
|
158 |
-
|
159 |
-
function rtTPGIsotopeFilter($this) {
|
160 |
-
var arg = "post_type=" + $this.val();
|
161 |
-
var bindElement = $this;
|
162 |
-
var target = jQuery('.field-holder.sc-isotope-filter .field > select');
|
163 |
-
tpgAjaxCall(bindElement, 'rtTPGIsotopeFilter', arg, function (data) {
|
164 |
-
if (data.error) {
|
165 |
-
alert(data.msg);
|
166 |
-
} else {
|
167 |
-
target.html(data.data);
|
168 |
-
tgpLiveReloadScript();
|
169 |
-
}
|
170 |
-
});
|
171 |
-
}
|
172 |
-
|
173 |
-
function rtTPGTermListByTaxonomy($this) {
|
174 |
-
var term = $this.val();
|
175 |
-
var targetHolder = jQuery('.rt-tpg-filter.taxonomy').children('.rt-tpg-filter-item').children('.field-holder').children('.term-filter-holder');
|
176 |
-
var target = targetHolder.children('.term-filter-item-container.' + term);
|
177 |
-
if ($this.is(':checked')) {
|
178 |
-
var arg = "taxonomy=" + $this.val();
|
179 |
-
var bindElement = $this;
|
180 |
-
tpgAjaxCall(bindElement, 'rtTPGTermListByTaxonomy', arg, function (data) {
|
181 |
//console.log(data);
|
182 |
if (data.error) {
|
183 |
alert(data.msg);
|
184 |
} else {
|
185 |
-
|
186 |
-
jQuery(data.data).prependTo(targetHolder).fadeIn('slow');
|
187 |
-
tgpLiveReloadScript();
|
188 |
}
|
189 |
});
|
190 |
-
} else {
|
191 |
-
target.hide('slow').html('').remove();
|
192 |
}
|
193 |
|
194 |
-
|
195 |
-
|
196 |
-
jQuery('.
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
jQuery('rt-response').hide();
|
205 |
-
var arg = jQuery(e).serialize();
|
206 |
-
var bindElement = jQuery('.rtSaveButton');
|
207 |
-
tpgAjaxCall(bindElement, 'rtTPGSettings', arg, function (data) {
|
208 |
-
if (data.error) {
|
209 |
-
jQuery('.rt-response').addClass('updated');
|
210 |
-
jQuery('.rt-response').removeClass('error');
|
211 |
-
jQuery('.rt-response').show('slow').text(data.msg);
|
212 |
} else {
|
213 |
-
jQuery('.rt-
|
214 |
-
jQuery('.rt-response').show('slow').text(data.msg);
|
215 |
}
|
216 |
-
}
|
|
|
217 |
|
218 |
-
|
|
|
|
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
-
function tpgAjaxCall(element, action, arg, handle) {
|
222 |
-
var data;
|
223 |
-
if (action) data = "action=" + action;
|
224 |
-
if (arg) data = arg + "&action=" + action;
|
225 |
-
if (arg && !action) data = arg;
|
226 |
|
227 |
-
|
228 |
-
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
}
|
231 |
-
jQuery.ajax({
|
232 |
-
type: "post",
|
233 |
-
url: rttpg.ajaxurl,
|
234 |
-
data: data,
|
235 |
-
beforeSend: function () {
|
236 |
-
jQuery("<span class='rt-loading'></span>").insertAfter(element);
|
237 |
-
},
|
238 |
-
success: function (data) {
|
239 |
-
jQuery(".rt-loading").remove();
|
240 |
-
handle(data);
|
241 |
-
}
|
242 |
-
});
|
243 |
-
}
|
244 |
|
245 |
-
function rtTgpFilter() {
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
|
|
|
|
255 |
|
256 |
-
}
|
257 |
|
258 |
-
function thpShowHideScMeta() {
|
259 |
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
} else {
|
265 |
-
jQuery(".field-holder.pagination").show();
|
266 |
-
jQuery(".field-holder.sc-isotope-filter").hide();
|
267 |
-
var pagination = jQuery("#rt-tpg-pagination").is(':checked');
|
268 |
-
if (pagination) {
|
269 |
-
jQuery(".field-holder.posts-per-page").show();
|
270 |
} else {
|
271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
}
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
|
|
|
|
|
|
|
|
|
|
|
285 |
|
286 |
-
if (jQuery("#rt-feature-image").is(':checked')) {
|
287 |
-
jQuery(".field-holder.feature-image-options").hide();
|
288 |
-
} else {
|
289 |
-
jQuery(".field-holder.feature-image-options").show();
|
290 |
}
|
291 |
|
292 |
-
}
|
|
|
293 |
|
294 |
-
function tgpLiveReloadScript() {
|
295 |
-
jQuery("select.rt-select2").select2({dropdownAutoWidth: true});
|
296 |
-
}
|
1 |
(function ($) {
|
2 |
'use strict';
|
3 |
|
4 |
+
/* rt tab active navigation */
|
5 |
+
$(".rt-tab-nav li").on('click', 'a', function (e) {
|
6 |
+
e.preventDefault();
|
7 |
+
var $this = $(this),
|
8 |
+
container = $this.parents('.rt-tab-container'),
|
9 |
+
nav = container.children('.rt-tab-nav'),
|
10 |
+
content = container.children(".rt-tab-content"),
|
11 |
+
$id = $this.attr('href');
|
12 |
+
console.log($id);
|
13 |
+
content.hide();
|
14 |
+
nav.find('li').removeClass('active');
|
15 |
+
$this.parent().addClass('active');
|
16 |
+
container.find($id).show();
|
17 |
+
});
|
18 |
|
19 |
+
if ($(".rt-select2").length && $.fn.select2) {
|
20 |
$(".rt-select2").select2({dropdownAutoWidth: true});
|
21 |
}
|
22 |
+
|
23 |
var postType = jQuery("#rc-sc-post-type").val();
|
24 |
rtTgpFilter();
|
25 |
+
detailLinkEffect();
|
26 |
thpShowHideScMeta();
|
27 |
renderTpgPreview();
|
28 |
+
$("#rttpg_meta")
|
29 |
+
.on('change', 'select,input', function () {
|
30 |
+
renderTpgPreview();
|
31 |
+
})
|
32 |
+
.on("input propertychange", function () {
|
33 |
+
renderTpgPreview();
|
34 |
+
});
|
35 |
+
var colorSlt = $("#rttpg_meta .rt-color");
|
36 |
+
if (colorSlt.length && $.fn.wpColorPicker) {
|
37 |
var cOptions = {
|
38 |
defaultColor: false,
|
39 |
change: function (event, ui) {
|
45 |
hide: true,
|
46 |
palettes: true
|
47 |
};
|
48 |
+
colorSlt.wpColorPicker(cOptions);
|
49 |
}
|
50 |
+
|
51 |
$(document).on('change', '#post_filter input[type=checkbox]', function () {
|
52 |
var id = $(this).val();
|
53 |
+
if (id === 'tpg_taxonomy') {
|
54 |
if (this.checked) {
|
55 |
rtTPGTaxonomyListByPostType(postType, $(this));
|
56 |
} else {
|
57 |
+
$('.rt-tpg-filter.taxonomy > .taxonomy-field').hide('slow').html('');
|
58 |
+
$('.rt-tpg-filter.taxonomy > .rt-tpg-filter-item .term-filter-holder').hide('slow').html('');
|
59 |
+
$('.rt-tpg-filter.taxonomy > .rt-tpg-filter-item .term-filter-item-relation').hide('slow');
|
60 |
}
|
61 |
}
|
62 |
if (this.checked) {
|
74 |
|
75 |
$(document).on('change', "#rt-tpg-pagination", function () {
|
76 |
if (this.checked) {
|
77 |
+
$(".rt-field-wrapper.posts-per-page").show();
|
78 |
} else {
|
79 |
+
$(".rt-field-wrapper.posts-per-page").hide();
|
80 |
}
|
81 |
});
|
82 |
|
83 |
$(document).on('change', "#rt-feature-image", function () {
|
84 |
if (this.checked) {
|
85 |
+
$(".rt-field-wrapper.feature-image-options").hide();
|
86 |
} else {
|
87 |
+
$(".rt-field-wrapper.feature-image-options").show();
|
88 |
}
|
89 |
});
|
90 |
|
102 |
$(".rt-tpg-filter.taxonomy > .taxonomy-field").html('');
|
103 |
$(".rt-tpg-filter.taxonomy > .rt-tpg-filter-item .term-filter-item-container").remove();
|
104 |
$(".rt-tpg-filter.hidden").hide();
|
105 |
+
$(".rt-field-wrapper.term-filter-item-relation ").hide();
|
106 |
}
|
107 |
});
|
108 |
|
109 |
+
$("#link_to_detail_page_holder").on("click", "input[type='radio']", function () {
|
110 |
+
detailLinkEffect();
|
111 |
+
});
|
112 |
+
|
113 |
+
function detailLinkEffect() {
|
114 |
+
var detailPageLink = $("#link_to_detail_page_holder input[name='link_to_detail_page']:checked").val();
|
115 |
+
if (detailPageLink === "yes") {
|
116 |
+
$(".rt-field-wrapper.tpg-link-target").show();
|
117 |
+
} else {
|
118 |
+
$(".rt-field-wrapper.tpg-link-target").hide();
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
|
123 |
function renderTpgPreview() {
|
124 |
if ($("#rttpg_meta").length) {
|
158 |
data: data,
|
159 |
beforeSend: function () {
|
160 |
if (element) {
|
161 |
+
$("<span class='rt-loading'> </span>").insertAfter(element);
|
162 |
}
|
163 |
},
|
164 |
success: function (data) {
|
170 |
});
|
171 |
}
|
172 |
|
|
|
173 |
|
174 |
+
function rtTPGTaxonomyListByPostType(postType, $this) {
|
175 |
|
176 |
+
var arg = "post_type=" + postType;
|
177 |
+
tpgAjaxCall($this, 'rtTPGTaxonomyListByPostType', arg, function (data) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
//console.log(data);
|
179 |
if (data.error) {
|
180 |
alert(data.msg);
|
181 |
} else {
|
182 |
+
jQuery('.rt-tpg-filter.taxonomy > .taxonomy-field').html(data.data).show('slow');
|
|
|
|
|
183 |
}
|
184 |
});
|
|
|
|
|
185 |
}
|
186 |
|
187 |
+
function rtTPGTermListByTaxonomy($this) {
|
188 |
+
var term = $this.val();
|
189 |
+
var targetHolder = jQuery('.rt-tpg-filter.taxonomy').children('.rt-tpg-filter-item').children('.rt-field-wrapper').children('.term-filter-holder');
|
190 |
+
var target = targetHolder.children('.term-filter-item-container.' + term);
|
191 |
+
if ($this.is(':checked')) {
|
192 |
+
var arg = "taxonomy=" + $this.val();
|
193 |
+
var bindElement = $this;
|
194 |
+
tpgAjaxCall(bindElement, 'rtTPGTermListByTaxonomy', arg, function (data) {
|
195 |
+
//console.log(data);
|
196 |
+
if (data.error) {
|
197 |
+
alert(data.msg);
|
198 |
+
} else {
|
199 |
+
targetHolder.show();
|
200 |
+
jQuery(data.data).prependTo(targetHolder).fadeIn('slow');
|
201 |
+
tgpLiveReloadScript();
|
202 |
+
}
|
203 |
+
});
|
204 |
+
} else {
|
205 |
+
target.hide('slow').html('').remove();
|
206 |
+
}
|
207 |
|
208 |
+
var termLength = jQuery('input[name="tpg_taxonomy[]"]:checked').length;
|
209 |
+
if (termLength > 1) {
|
210 |
+
jQuery('.rt-field-wrapper.term-filter-item-relation ').show('slow');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
} else {
|
212 |
+
jQuery('.rt-field-wrapper.term-filter-item-relation ').hide('slow');
|
|
|
213 |
}
|
214 |
+
}
|
215 |
+
|
216 |
|
217 |
+
function tgpLiveReloadScript() {
|
218 |
+
$("select.rt-select2").select2({dropdownAutoWidth: true});
|
219 |
+
}
|
220 |
|
221 |
+
$("#rt-tpg-settings-form").on('submit', function (e) {
|
222 |
+
e.preventDefault();
|
223 |
+
var form = $(this),
|
224 |
+
response_wrap = form.next('.rt-response'),
|
225 |
+
arg = form.serialize(),
|
226 |
+
bindElement = form.find('.rtSaveButton');
|
227 |
+
response_wrap.hide();
|
228 |
+
tpgAjaxCall(bindElement, 'rtTPGSettings', arg, function (data) {
|
229 |
+
if (!data.error) {
|
230 |
+
response_wrap.removeClass('error').addClass('success');
|
231 |
+
response_wrap.show('slow').text(data.msg);
|
232 |
+
} else {
|
233 |
+
response_wrap.addClass('error').removeClass('success');
|
234 |
+
response_wrap.show('slow').text(data.msg);
|
235 |
+
}
|
236 |
+
});
|
237 |
+
});
|
238 |
|
|
|
|
|
|
|
|
|
|
|
239 |
|
240 |
+
function rtTPGIsotopeFilter($this) {
|
241 |
+
var arg = "post_type=" + $this.val();
|
242 |
+
var bindElement = $this;
|
243 |
+
var target = jQuery('.rt-field-wrapper.sc-isotope-filter .field > select');
|
244 |
+
tpgAjaxCall(bindElement, 'rtTPGIsotopeFilter', arg, function (data) {
|
245 |
+
if (data.error) {
|
246 |
+
alert(data.msg);
|
247 |
+
} else {
|
248 |
+
target.html(data.data);
|
249 |
+
tgpLiveReloadScript();
|
250 |
+
}
|
251 |
+
});
|
252 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
|
254 |
+
function rtTgpFilter() {
|
255 |
+
$("#post_filter input[type=checkbox]:checked").each(function () {
|
256 |
+
var id = $(this).val();
|
257 |
+
$(".rt-tpg-filter." + id).show();
|
258 |
+
});
|
259 |
|
260 |
+
$("#post-taxonomy input[type=checkbox]:checked").each(function () {
|
261 |
+
var id = $(this).val();
|
262 |
+
$(".filter-item." + id).show();
|
263 |
+
});
|
264 |
+
|
265 |
+
}
|
266 |
|
|
|
267 |
|
268 |
+
function thpShowHideScMeta() {
|
269 |
|
270 |
+
var layout = $("#rt-tpg-sc-layout").val();
|
271 |
+
if (layout === 'isotope1') {
|
272 |
+
$(".rt-field-wrapper.pagination, .rt-field-wrapper.posts-per-page").hide();
|
273 |
+
$(".rt-field-wrapper.sc-isotope-filter").show();
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
} else {
|
275 |
+
$(".rt-field-wrapper.pagination").show();
|
276 |
+
$(".rt-field-wrapper.sc-isotope-filter").hide();
|
277 |
+
var pagination = $("#rt-tpg-pagination").is(':checked');
|
278 |
+
if (pagination) {
|
279 |
+
$(".rt-field-wrapper.posts-per-page").show();
|
280 |
+
} else {
|
281 |
+
$(".rt-field-wrapper.posts-per-page").hide();
|
282 |
+
}
|
283 |
}
|
284 |
+
if (layout === 'layout2' || layout === 'layout3') {
|
285 |
+
$('.holder-layout2-image-column').show();
|
286 |
+
} else {
|
287 |
+
$('.holder-layout2-image-column').hide();
|
288 |
+
}
|
289 |
+
if ($("#post-taxonomy input[name='tpg_taxonomy[]']").is(":checked")) {
|
290 |
+
$(".rt-tpg-filter-item.term-filter-item").show();
|
291 |
+
} else {
|
292 |
+
$(".rt-tpg-filter-item.term-filter-item").hide();
|
293 |
+
}
|
294 |
+
|
295 |
|
296 |
+
if ($("#rt-feature-image").is(':checked')) {
|
297 |
+
$(".rt-field-wrapper.feature-image-options").hide();
|
298 |
+
} else {
|
299 |
+
$(".rt-field-wrapper.feature-image-options").show();
|
300 |
+
}
|
301 |
|
|
|
|
|
|
|
|
|
302 |
}
|
303 |
|
304 |
+
})(jQuery);
|
305 |
+
|
306 |
|
|
|
|
|
|
languages/the-post-grid.pot
CHANGED
@@ -3,8 +3,8 @@ msgid ""
|
|
3 |
msgstr ""
|
4 |
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
5 |
"Project-Id-Version: The Post Grid\n"
|
6 |
-
"POT-Creation-Date:
|
7 |
-
"PO-Revision-Date:
|
8 |
"Last-Translator: \n"
|
9 |
"Language-Team: \n"
|
10 |
"MIME-Version: 1.0\n"
|
@@ -20,32 +20,32 @@ msgstr ""
|
|
20 |
"X-Poedit-SearchPath-0: .\n"
|
21 |
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
22 |
|
23 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
24 |
msgid "Settings successfully updated"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
28 |
msgid "Security Error !!"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
32 |
-
msgid "
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
36 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
37 |
msgid "Security error"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
41 |
msgid "Select Short code"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
45 |
msgid "Default"
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: lib/classes/rtTPGAjaxResponse.php:
|
49 |
msgid "No shortCode found."
|
50 |
msgstr ""
|
51 |
|
@@ -96,35 +96,49 @@ msgstr ""
|
|
96 |
msgid "Settings"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: lib/classes/rtTPGMeta.php:
|
100 |
msgid "Shortcode"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: lib/classes/rtTPGMeta.php:
|
104 |
msgid "Short Code Generator"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: lib/classes/rtTPGMeta.php:
|
108 |
-
msgid "
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: lib/classes/rtTPGMeta.php:
|
112 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: lib/classes/rtTPGMeta.php:
|
|
|
|
|
|
|
|
|
116 |
msgid "Post Source"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: lib/classes/rtTPGMeta.php:
|
120 |
msgid "Layout Settings"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: lib/classes/rtTPGMeta.php:
|
124 |
msgid "Field Selection"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: lib/classes/rtTPGMeta.php:
|
128 |
msgid "Style"
|
129 |
msgstr ""
|
130 |
|
@@ -157,7 +171,7 @@ msgid "Show all text"
|
|
157 |
msgstr ""
|
158 |
|
159 |
#: lib/classes/rtTPGOptions.php:191 lib/classes/rtTPGShortCode.php:71
|
160 |
-
#: lib/classes/rtTPGShortCode.php:
|
161 |
msgid "Show all"
|
162 |
msgstr ""
|
163 |
|
@@ -214,72 +228,96 @@ msgstr ""
|
|
214 |
msgid "Title tag"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: lib/classes/rtTPGOptions.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
msgid "Title color"
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: lib/classes/rtTPGOptions.php:
|
222 |
msgid "Title hover color"
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: lib/classes/rtTPGOptions.php:
|
226 |
msgid "Read more button border radius"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: lib/classes/rtTPGOptions.php:
|
230 |
msgid "Leave it blank for default"
|
231 |
msgstr ""
|
232 |
|
233 |
-
#: lib/classes/rtTPGOptions.php:
|
234 |
msgid "Feature Image"
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: lib/classes/rtTPGOptions.php:
|
238 |
msgid "First Image from content"
|
239 |
msgstr ""
|
240 |
|
241 |
-
#: lib/classes/rtTPGOptions.php:
|
242 |
msgid "Title"
|
243 |
msgstr ""
|
244 |
|
245 |
-
#: lib/classes/rtTPGOptions.php:
|
246 |
msgid "Excerpt"
|
247 |
msgstr ""
|
248 |
|
249 |
-
#: lib/classes/rtTPGOptions.php:
|
250 |
-
#: lib/classes/rtTPGShortCode.php:
|
251 |
msgid "Read More"
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: lib/classes/rtTPGOptions.php:
|
255 |
msgid "Post Date"
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: lib/classes/rtTPGOptions.php:
|
259 |
msgid "Author"
|
260 |
msgstr ""
|
261 |
|
262 |
-
#: lib/classes/rtTPGOptions.php:
|
263 |
msgid "Categories"
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: lib/classes/rtTPGOptions.php:
|
267 |
msgid "Tags"
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: lib/classes/rtTPGOptions.php:
|
271 |
msgid "Comment Count"
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: lib/classes/
|
|
|
|
|
|
|
|
|
275 |
msgid "No post found"
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: lib/classes/rtTPGShortCode.php:
|
279 |
msgid "Session Error !!"
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: lib/classes/rtTPGShortCode.php:
|
283 |
msgid "No shortCode found"
|
284 |
msgstr ""
|
285 |
|
@@ -287,7 +325,19 @@ msgstr ""
|
|
287 |
msgid "Post Grid"
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: lib/views/settings/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
msgid "The Post Grid Settings"
|
292 |
msgstr ""
|
293 |
|
@@ -295,8 +345,8 @@ msgstr ""
|
|
295 |
msgid "General settings"
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: lib/views/settings/settings.php:
|
299 |
-
msgid "
|
300 |
msgstr ""
|
301 |
|
302 |
#: lib/widgets/RT_TPGWidget.php:14
|
3 |
msgstr ""
|
4 |
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
5 |
"Project-Id-Version: The Post Grid\n"
|
6 |
+
"POT-Creation-Date: 2020-02-12 16:37+0600\n"
|
7 |
+
"PO-Revision-Date: 2020-02-12 16:37+0600\n"
|
8 |
"Last-Translator: \n"
|
9 |
"Language-Team: \n"
|
10 |
"MIME-Version: 1.0\n"
|
20 |
"X-Poedit-SearchPath-0: .\n"
|
21 |
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
22 |
|
23 |
+
#: lib/classes/rtTPGAjaxResponse.php:27
|
24 |
msgid "Settings successfully updated"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: lib/classes/rtTPGAjaxResponse.php:29
|
28 |
msgid "Security Error !!"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: lib/classes/rtTPGAjaxResponse.php:57
|
32 |
+
msgid "No Taxonomy found"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: lib/classes/rtTPGAjaxResponse.php:61 lib/classes/rtTPGAjaxResponse.php:80
|
36 |
+
#: lib/classes/rtTPGAjaxResponse.php:119
|
37 |
msgid "Security error"
|
38 |
msgstr ""
|
39 |
|
40 |
+
#: lib/classes/rtTPGAjaxResponse.php:138
|
41 |
msgid "Select Short code"
|
42 |
msgstr ""
|
43 |
|
44 |
+
#: lib/classes/rtTPGAjaxResponse.php:140
|
45 |
msgid "Default"
|
46 |
msgstr ""
|
47 |
|
48 |
+
#: lib/classes/rtTPGAjaxResponse.php:149
|
49 |
msgid "No shortCode found."
|
50 |
msgstr ""
|
51 |
|
96 |
msgid "Settings"
|
97 |
msgstr ""
|
98 |
|
99 |
+
#: lib/classes/rtTPGMeta.php:28
|
100 |
msgid "Shortcode"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: lib/classes/rtTPGMeta.php:83
|
104 |
msgid "Short Code Generator"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: lib/classes/rtTPGMeta.php:90
|
108 |
+
msgid "Layout Preview"
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: lib/classes/rtTPGMeta.php:98 lib/classes/rtTPGMeta.php:123
|
112 |
+
msgid "Documentation"
|
113 |
+
msgstr ""
|
114 |
+
|
115 |
+
#: lib/classes/rtTPGMeta.php:110
|
116 |
+
msgid "Update Pro To Get More Features"
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: lib/classes/rtTPGMeta.php:124
|
120 |
+
msgid ""
|
121 |
+
"Get started by spending some time with the documentation we included step by "
|
122 |
+
"step process with screenshots with video."
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: lib/classes/rtTPGMeta.php:133
|
126 |
+
msgid "Get Support"
|
127 |
+
msgstr ""
|
128 |
+
|
129 |
+
#: lib/classes/rtTPGMeta.php:174
|
130 |
msgid "Post Source"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: lib/classes/rtTPGMeta.php:175
|
134 |
msgid "Layout Settings"
|
135 |
msgstr ""
|
136 |
|
137 |
+
#: lib/classes/rtTPGMeta.php:176
|
138 |
msgid "Field Selection"
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: lib/classes/rtTPGMeta.php:177
|
142 |
msgid "Style"
|
143 |
msgstr ""
|
144 |
|
171 |
msgstr ""
|
172 |
|
173 |
#: lib/classes/rtTPGOptions.php:191 lib/classes/rtTPGShortCode.php:71
|
174 |
+
#: lib/classes/rtTPGShortCode.php:101
|
175 |
msgid "Show all"
|
176 |
msgstr ""
|
177 |
|
228 |
msgid "Title tag"
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: lib/classes/rtTPGOptions.php:322
|
232 |
+
msgid "Link To Detail Page"
|
233 |
+
msgstr ""
|
234 |
+
|
235 |
+
#: lib/classes/rtTPGOptions.php:333
|
236 |
+
msgid "Link Target"
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: lib/classes/rtTPGOptions.php:346
|
240 |
+
msgid "Character"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
#: lib/classes/rtTPGOptions.php:347
|
244 |
+
msgid "Word"
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
+
#: lib/classes/rtTPGOptions.php:350
|
248 |
+
msgid "Full Content"
|
249 |
+
msgstr ""
|
250 |
+
|
251 |
+
#: lib/classes/rtTPGOptions.php:405
|
252 |
msgid "Title color"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: lib/classes/rtTPGOptions.php:412
|
256 |
msgid "Title hover color"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: lib/classes/rtTPGOptions.php:421
|
260 |
msgid "Read more button border radius"
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: lib/classes/rtTPGOptions.php:422
|
264 |
msgid "Leave it blank for default"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: lib/classes/rtTPGOptions.php:451
|
268 |
msgid "Feature Image"
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: lib/classes/rtTPGOptions.php:452
|
272 |
msgid "First Image from content"
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: lib/classes/rtTPGOptions.php:480
|
276 |
msgid "Title"
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: lib/classes/rtTPGOptions.php:481
|
280 |
msgid "Excerpt"
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: lib/classes/rtTPGOptions.php:482 lib/classes/rtTPGShortCode.php:69
|
284 |
+
#: lib/classes/rtTPGShortCode.php:99
|
285 |
msgid "Read More"
|
286 |
msgstr ""
|
287 |
|
288 |
+
#: lib/classes/rtTPGOptions.php:483
|
289 |
msgid "Post Date"
|
290 |
msgstr ""
|
291 |
|
292 |
+
#: lib/classes/rtTPGOptions.php:484
|
293 |
msgid "Author"
|
294 |
msgstr ""
|
295 |
|
296 |
+
#: lib/classes/rtTPGOptions.php:485
|
297 |
msgid "Categories"
|
298 |
msgstr ""
|
299 |
|
300 |
+
#: lib/classes/rtTPGOptions.php:486
|
301 |
msgid "Tags"
|
302 |
msgstr ""
|
303 |
|
304 |
+
#: lib/classes/rtTPGOptions.php:487
|
305 |
msgid "Comment Count"
|
306 |
msgstr ""
|
307 |
|
308 |
+
#: lib/classes/rtTPGOptions.php:508
|
309 |
+
msgid "Get Pro Version"
|
310 |
+
msgstr ""
|
311 |
+
|
312 |
+
#: lib/classes/rtTPGShortCode.php:352
|
313 |
msgid "No post found"
|
314 |
msgstr ""
|
315 |
|
316 |
+
#: lib/classes/rtTPGShortCode.php:380
|
317 |
msgid "Session Error !!"
|
318 |
msgstr ""
|
319 |
|
320 |
+
#: lib/classes/rtTPGShortCode.php:382
|
321 |
msgid "No shortCode found"
|
322 |
msgstr ""
|
323 |
|
325 |
msgid "Post Grid"
|
326 |
msgstr ""
|
327 |
|
328 |
+
#: lib/views/settings/post-source.php:19
|
329 |
+
msgid "Advance filter options"
|
330 |
+
msgstr ""
|
331 |
+
|
332 |
+
#: lib/views/settings/post-source.php:103
|
333 |
+
msgid "Terms"
|
334 |
+
msgstr ""
|
335 |
+
|
336 |
+
#: lib/views/settings/post-source.php:125
|
337 |
+
msgid "Order Settings"
|
338 |
+
msgstr ""
|
339 |
+
|
340 |
+
#: lib/views/settings/settings.php:3
|
341 |
msgid "The Post Grid Settings"
|
342 |
msgstr ""
|
343 |
|
345 |
msgid "General settings"
|
346 |
msgstr ""
|
347 |
|
348 |
+
#: lib/views/settings/settings.php:14
|
349 |
+
msgid "Save Changes"
|
350 |
msgstr ""
|
351 |
|
352 |
#: lib/widgets/RT_TPGWidget.php:14
|
lib/classes/rtTPGAjaxResponse.php
CHANGED
@@ -1,156 +1,157 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
|
154 |
-
|
155 |
|
156 |
endif;
|
1 |
<?php
|
2 |
|
3 |
+
if (!class_exists('rtTPGAjaxResponse')):
|
4 |
|
5 |
+
class rtTPGAjaxResponse
|
6 |
+
{
|
7 |
+
function __construct() {
|
8 |
+
add_action('wp_ajax_rtTPGSettings', array($this, 'rtTPGSaveSettings'));
|
9 |
+
add_action('wp_ajax_rtTPGShortCodeList', array($this, 'shortCodeList'));
|
10 |
+
add_action('wp_ajax_rtTPGTaxonomyListByPostType', array($this, 'rtTPGTaxonomyListByPostType'));
|
11 |
+
add_action('wp_ajax_rtTPGIsotopeFilter', array($this, 'rtTPGIsotopeFilter'));
|
12 |
+
add_action('wp_ajax_rtTPGTermListByTaxonomy', array($this, 'rtTPGTermListByTaxonomy'));
|
13 |
+
}
|
14 |
|
15 |
+
function rtTPGSaveSettings() {
|
16 |
+
global $rtTPG;
|
17 |
+
$rtTPG->rtTPGSettingFields();
|
18 |
+
$error = true;
|
19 |
+
$msg = null;
|
20 |
|
21 |
+
if ($rtTPG->verifyNonce()) {
|
22 |
+
unset($_REQUEST['action']);
|
23 |
+
unset($_REQUEST[$rtTPG->nonceId()]);
|
24 |
+
unset($_REQUEST['_wp_http_referer']);
|
25 |
+
update_option($rtTPG->options['settings'], $_REQUEST);
|
26 |
+
$error = false;
|
27 |
+
$msg = __('Settings successfully updated', 'the-post-grid');
|
28 |
+
} else {
|
29 |
+
$msg = __('Security Error !!', 'the-post-grid');
|
30 |
+
}
|
31 |
+
wp_send_json(array(
|
32 |
+
'error' => $error,
|
33 |
+
'msg' => $msg
|
34 |
+
));
|
35 |
+
die();
|
36 |
+
}
|
37 |
|
38 |
+
function rtTPGTaxonomyListByPostType() {
|
39 |
+
global $rtTPG;
|
40 |
+
$error = true;
|
41 |
+
$msg = $data = null;
|
42 |
+
if ($rtTPG->verifyNonce()) {
|
43 |
+
$error = false;
|
44 |
+
$taxonomies = $rtTPG->rt_get_all_taxonomy_by_post_type(isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : null);
|
45 |
+
if (is_array($taxonomies) && !empty($taxonomies)) {
|
46 |
+
$data .= $rtTPG->rtFieldGenerator(
|
47 |
+
array(
|
48 |
+
'type' => 'checkbox',
|
49 |
+
'name' => 'tpg_taxonomy',
|
50 |
+
'label' => 'Taxonomy',
|
51 |
+
'id' => 'post-taxonomy',
|
52 |
+
"multiple" => true,
|
53 |
+
'options' => $taxonomies
|
54 |
+
)
|
55 |
+
);
|
56 |
+
} else {
|
57 |
+
$data = '<div class="rt-field-wrapper">' . __('No Taxonomy found', 'the-post-grid') . '</div>';
|
58 |
+
}
|
59 |
|
60 |
+
} else {
|
61 |
+
$msg = __('Security error', 'the-post-grid');
|
62 |
+
}
|
63 |
+
wp_send_json(array('error' => $error, 'msg' => $msg, 'data' => $data));
|
64 |
+
die();
|
65 |
+
}
|
66 |
|
67 |
+
function rtTPGIsotopeFilter() {
|
68 |
+
global $rtTPG;
|
69 |
+
$error = true;
|
70 |
+
$msg = $data = null;
|
71 |
+
if ($rtTPG->verifyNonce()) {
|
72 |
+
$error = false;
|
73 |
+
$taxonomies = $rtTPG->rt_get_taxonomy_for_isotope_filter(isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : null);
|
74 |
+
if (is_array($taxonomies) && !empty($taxonomies)) {
|
75 |
+
foreach ($taxonomies as $tKey => $tax) {
|
76 |
+
$data .= "<option value='{$tKey}'>{$tax}</option>";
|
77 |
+
}
|
78 |
+
}
|
79 |
+
} else {
|
80 |
+
$msg = __('Security error', 'the-post-grid');
|
81 |
+
}
|
82 |
+
wp_send_json(array('error' => $error, 'msg' => $msg, 'data' => $data));
|
83 |
+
die();
|
84 |
+
}
|
85 |
|
86 |
+
function rtTPGTermListByTaxonomy() {
|
87 |
+
global $rtTPG;
|
88 |
+
$error = true;
|
89 |
+
$msg = $data = null;
|
90 |
+
if ($rtTPG->verifyNonce()) {
|
91 |
+
$error = false;
|
92 |
+
$taxonomy = isset($_REQUEST['taxonomy']) ? $_REQUEST['taxonomy'] : null;
|
93 |
+
$data .= "<div class='term-filter-item-container {$taxonomy}'>";
|
94 |
+
$data .= $rtTPG->rtFieldGenerator(
|
95 |
+
array(
|
96 |
+
'type' => 'select',
|
97 |
+
'name' => 'term_' . $taxonomy,
|
98 |
+
'label' => ucfirst(str_replace('_', ' ', $taxonomy)),
|
99 |
+
'class' => 'rt-select2 full',
|
100 |
+
'id' => 'term-' . mt_rand(),
|
101 |
+
'holderClass' => "term-filter-item {$taxonomy}",
|
102 |
+
'value' => null,
|
103 |
+
"multiple" => true,
|
104 |
+
'options' => $rtTPG->rt_get_all_term_by_taxonomy($taxonomy)
|
105 |
+
)
|
106 |
+
);
|
107 |
+
$data .= $rtTPG->rtFieldGenerator(
|
108 |
+
array(
|
109 |
+
'type' => 'select',
|
110 |
+
'name' => 'term_operator_' . $taxonomy,
|
111 |
+
'label' => 'Operator',
|
112 |
+
'class' => 'rt-select2 full',
|
113 |
+
'holderClass' => "term-filter-item-operator {$taxonomy}",
|
114 |
+
'options' => $rtTPG->rtTermOperators()
|
115 |
+
)
|
116 |
+
);
|
117 |
+
$data .= "</div>";
|
118 |
+
} else {
|
119 |
+
$msg = __('Security error', 'the-post-grid');
|
120 |
+
}
|
121 |
+
wp_send_json(array('error' => $error, 'msg' => $msg, 'data' => $data));
|
122 |
+
die();
|
123 |
+
}
|
124 |
|
125 |
+
function shortCodeList() {
|
126 |
+
global $rtTPG;
|
127 |
+
$html = null;
|
128 |
+
$scQ = new WP_Query(array('post_type' => $rtTPG->post_type,
|
129 |
+
'order_by' => 'title',
|
130 |
+
'order' => 'DESC',
|
131 |
+
'post_status' => 'publish',
|
132 |
+
'posts_per_page' => -1
|
133 |
+
));
|
134 |
+
if ($scQ->have_posts()) {
|
135 |
|
136 |
+
$html .= "<div class='mce-container mce-form'>";
|
137 |
+
$html .= "<div class='mce-container-body'>";
|
138 |
+
$html .= '<label class="mce-widget mce-label" style="padding: 20px;font-weight: bold;" for="scid">' . __('Select Short code', 'the-post-grid') . '</label>';
|
139 |
+
$html .= "<select name='id' id='scid' style='width: 150px;margin: 15px;'>";
|
140 |
+
$html .= "<option value=''>" . __('Default', 'the-post-grid') . "</option>";
|
141 |
+
while ($scQ->have_posts()) {
|
142 |
+
$scQ->the_post();
|
143 |
+
$html .= "<option value='" . get_the_ID() . "'>" . get_the_title() . "</option>";
|
144 |
+
}
|
145 |
+
$html .= "</select>";
|
146 |
+
$html .= "</div>";
|
147 |
+
$html .= "</div>";
|
148 |
+
} else {
|
149 |
+
$html .= "<div>" . __('No shortCode found.', 'the-post-grid') . "</div>";
|
150 |
+
}
|
151 |
+
echo $html;
|
152 |
+
die();
|
153 |
+
}
|
154 |
|
155 |
+
}
|
156 |
|
157 |
endif;
|
lib/classes/rtTPGHelper.php
CHANGED
@@ -1,359 +1,338 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
<li>Fully responsive and mobile friendly.</li>
|
338 |
-
<li>55 Different Layouts</li>
|
339 |
-
<li>Even and Masonry Grid.</li>
|
340 |
-
<li>WooCommerce supported.</li>
|
341 |
-
<li>Custom Post Type Supported</li>
|
342 |
-
<li>Display posts by any Taxonomy like category(s), tag(s), author(s), keyword(s)</li>
|
343 |
-
<li>Order by Id, Title, Created date, Modified date and Menu order.</li>
|
344 |
-
<li>Display image size (thumbnail, medium, large, full)</li>
|
345 |
-
<li>Isotope filter for any taxonomy ie. categories, tags...</li>
|
346 |
-
<li>Query Post with Relation.</li>
|
347 |
-
<li>Fields Selection.</li>
|
348 |
-
<li>All Text and Color control.</li>
|
349 |
-
<li>Enable/Disable Pagination.</li>
|
350 |
-
<li>AJAX Pagination (Load more and Load on Scrolling)</li>
|
351 |
-
<li> and many more .......</li>
|
352 |
-
</ol>";
|
353 |
-
|
354 |
-
return $html;
|
355 |
-
}
|
356 |
-
|
357 |
-
}
|
358 |
|
359 |
endif;
|
1 |
<?php
|
2 |
|
3 |
+
if (!class_exists('rtTPGHelper')):
|
4 |
+
|
5 |
+
class rtTPGHelper
|
6 |
+
{
|
7 |
+
function verifyNonce() {
|
8 |
+
global $rtTPG;
|
9 |
+
$nonce = isset($_REQUEST[$this->nonceId()]) ? $_REQUEST[$this->nonceId()] : null;
|
10 |
+
$nonceText = $rtTPG->nonceText();
|
11 |
+
if (!wp_verify_nonce($nonce, $nonceText)) {
|
12 |
+
return false;
|
13 |
+
}
|
14 |
+
|
15 |
+
return true;
|
16 |
+
}
|
17 |
+
|
18 |
+
function nonceText() {
|
19 |
+
return "rttpg_nonce_secret";
|
20 |
+
}
|
21 |
+
|
22 |
+
function nonceId() {
|
23 |
+
return "rttpg_nonce";
|
24 |
+
}
|
25 |
+
|
26 |
+
function rtAllOptionFields() {
|
27 |
+
global $rtTPG;
|
28 |
+
$fields = array();
|
29 |
+
$fieldsA = array_merge(
|
30 |
+
$rtTPG->rtTPGCommonFilterFields(),
|
31 |
+
$rtTPG->rtTPGLayoutSettingFields(),
|
32 |
+
$rtTPG->rtTPGStyleFields()
|
33 |
+
);
|
34 |
+
foreach ($fieldsA as $field) {
|
35 |
+
$fields[] = $field;
|
36 |
+
}
|
37 |
+
array_push($fields, $rtTPG->rtTPGPostType());
|
38 |
+
array_push($fields, $rtTPG->rtTPAdvanceFilters());
|
39 |
+
array_push($fields, $rtTPG->itemFields());
|
40 |
+
|
41 |
+
return $fields;
|
42 |
+
}
|
43 |
+
|
44 |
+
function rt_get_all_term_by_taxonomy($taxonomy = null) {
|
45 |
+
$terms = array();
|
46 |
+
if ($taxonomy) {
|
47 |
+
$tList = get_terms(array($taxonomy), array('hide_empty' => 0));
|
48 |
+
if (is_array($tList) && !empty($tList) && empty($tList['errors'])) {
|
49 |
+
foreach ($tList as $term) {
|
50 |
+
$terms[$term->term_id] = $term->name;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
return $terms;
|
56 |
+
}
|
57 |
+
|
58 |
+
function rt_get_taxonomy_for_isotope_filter($post_type = null) {
|
59 |
+
if (!$post_type) {
|
60 |
+
$post_type = get_post_meta(get_the_ID(), 'tpg_post_type', true);
|
61 |
+
}
|
62 |
+
if (!$post_type) {
|
63 |
+
$post_type = 'post';
|
64 |
+
}
|
65 |
+
|
66 |
+
return $this->rt_get_all_taxonomy_by_post_type($post_type);
|
67 |
+
}
|
68 |
+
|
69 |
+
function rt_get_all_taxonomy_by_post_type($post_type = null) {
|
70 |
+
$taxonomies = array();
|
71 |
+
if ($post_type && post_type_exists($post_type)) {
|
72 |
+
$taxObj = get_object_taxonomies($post_type, 'objects');
|
73 |
+
if (is_array($taxObj) && !empty($taxObj)) {
|
74 |
+
foreach ($taxObj as $tKey => $taxonomy) {
|
75 |
+
$taxonomies[$tKey] = $taxonomy->label;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
if ($post_type == 'post') {
|
80 |
+
unset($taxonomies['post_format']);
|
81 |
+
}
|
82 |
+
|
83 |
+
return $taxonomies;
|
84 |
+
}
|
85 |
+
|
86 |
+
function rt_get_users() {
|
87 |
+
$users = array();
|
88 |
+
$u = get_users(apply_filters('tpg_author_arg', array()));
|
89 |
+
if (!empty($u)) {
|
90 |
+
foreach ($u as $user) {
|
91 |
+
$users[$user->ID] = $user->display_name;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
return $users;
|
96 |
+
}
|
97 |
+
|
98 |
+
function getAllTPGShortCodeList() {
|
99 |
+
global $rtTPG;
|
100 |
+
$scList = null;
|
101 |
+
$scQ = get_posts(array(
|
102 |
+
'post_type' => $rtTPG->post_type,
|
103 |
+
'order_by' => 'title',
|
104 |
+
'order' => 'ASC',
|
105 |
+
'post_status' => 'publish',
|
106 |
+
'posts_per_page' => -1
|
107 |
+
));
|
108 |
+
if (!empty($scQ)) {
|
109 |
+
foreach ($scQ as $sc) {
|
110 |
+
$scList[$sc->ID] = $sc->post_title;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
return $scList;
|
115 |
+
}
|
116 |
+
|
117 |
+
function rtFieldGenerator($fields = array(), $multi = false) {
|
118 |
+
$html = null;
|
119 |
+
if (is_array($fields) && !empty($fields)) {
|
120 |
+
$rtField = new rtTPGField();
|
121 |
+
if ($multi) {
|
122 |
+
foreach ($fields as $field) {
|
123 |
+
$html .= $rtField->Field($field);
|
124 |
+
}
|
125 |
+
} else {
|
126 |
+
$html .= $rtField->Field($fields);
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
return $html;
|
131 |
+
}
|
132 |
+
|
133 |
+
function rtFieldGeneratorBackup($fields = array(), $multi = false) {
|
134 |
+
$html = null;
|
135 |
+
if (is_array($fields) && !empty($fields)) {
|
136 |
+
$rtField = new rtTPGField();
|
137 |
+
if ($multi) {
|
138 |
+
$i = 0;
|
139 |
+
$trigger = 0;
|
140 |
+
foreach ($fields as $field) {
|
141 |
+
$html .= ($trigger == 0 ? "<div class='rt-row'>" : null);
|
142 |
+
$html .= $rtField->Field($field);
|
143 |
+
$i++;
|
144 |
+
$trigger++;
|
145 |
+
if ($trigger == 2 || count($fields) == $i) {
|
146 |
+
$html .= "</div>";
|
147 |
+
$trigger = 0;
|
148 |
+
}
|
149 |
+
}
|
150 |
+
} else {
|
151 |
+
$html .= "<div class='rt-row'>";
|
152 |
+
$html .= $rtField->Field($fields);
|
153 |
+
$html .= "</div>";
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
return $html;
|
158 |
+
}
|
159 |
+
|
160 |
+
function get_image_sizes() {
|
161 |
+
global $_wp_additional_image_sizes;
|
162 |
+
|
163 |
+
$sizes = array();
|
164 |
+
|
165 |
+
foreach (get_intermediate_image_sizes() as $_size) {
|
166 |
+
if (in_array($_size, array('thumbnail', 'medium', 'large'))) {
|
167 |
+
$sizes[$_size]['width'] = get_option("{$_size}_size_w");
|
168 |
+
$sizes[$_size]['height'] = get_option("{$_size}_size_h");
|
169 |
+
$sizes[$_size]['crop'] = (bool)get_option("{$_size}_crop");
|
170 |
+
} elseif (isset($_wp_additional_image_sizes[$_size])) {
|
171 |
+
$sizes[$_size] = array(
|
172 |
+
'width' => $_wp_additional_image_sizes[$_size]['width'],
|
173 |
+
'height' => $_wp_additional_image_sizes[$_size]['height'],
|
174 |
+
'crop' => $_wp_additional_image_sizes[$_size]['crop'],
|
175 |
+
);
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
+
$imgSize = array();
|
180 |
+
foreach ($sizes as $key => $img) {
|
181 |
+
$imgSize[$key] = ucfirst($key) . " ({$img['width']}*{$img['height']})";
|
182 |
+
}
|
183 |
+
|
184 |
+
return $imgSize;
|
185 |
+
}
|
186 |
+
|
187 |
+
function getFeatureImageSrc($post_id = null, $fImgSize = 'medium', $mediaSource = 'feature_image') {
|
188 |
+
$imgSrc = null;
|
189 |
+
if ($mediaSource == 'feature_image') {
|
190 |
+
if ($aID = get_post_thumbnail_id($post_id)) {
|
191 |
+
$image = wp_get_attachment_image_src($aID, $fImgSize);
|
192 |
+
$imgSrc = $image[0];
|
193 |
+
}
|
194 |
+
} else if ($mediaSource == 'first_image') {
|
195 |
+
if ($img = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content($post_id),
|
196 |
+
$matches)) {
|
197 |
+
$imgSrc = $matches[1][0];
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
return $imgSrc;
|
202 |
+
}
|
203 |
+
|
204 |
+
function get_the_title($post_id, $data = array()) {
|
205 |
+
$title = $originalTitle = get_the_title($post_id);
|
206 |
+
$limit = isset($data['title_limit']) ? abs($data['title_limit']) : 0;
|
207 |
+
$limit_type = isset($data['title_limit_type']) ? trim($data['title_limit_type']) : 'character';
|
208 |
+
if ($limit) {
|
209 |
+
if ($limit_type == "word") {
|
210 |
+
$limit = $limit + 1;
|
211 |
+
$title = explode(' ', $title, $limit);
|
212 |
+
if (count($title) >= $limit) {
|
213 |
+
array_pop($title);
|
214 |
+
$title = implode(" ", $title);
|
215 |
+
} else {
|
216 |
+
$title = $originalTitle;
|
217 |
+
}
|
218 |
+
} else {
|
219 |
+
if ($limit > 0 && strlen($title) > $limit) {
|
220 |
+
$title = mb_substr($title, 0, $limit, "utf-8");
|
221 |
+
$title = preg_replace('/\W\w+\s*(\W*)$/', '$1', $title);
|
222 |
+
}
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
return apply_filters('tpg_get_the_title', $title, $post_id, $data, $originalTitle);
|
227 |
+
}
|
228 |
+
|
229 |
+
function get_the_excerpt($post_id, $data = array()) {
|
230 |
+
$type = $data['excerpt_type'];
|
231 |
+
if ($type == 'full') {
|
232 |
+
ob_start();
|
233 |
+
the_content();
|
234 |
+
$content = ob_get_clean();
|
235 |
+
|
236 |
+
return apply_filters('tpg_content_full', $content, $post_id, $data);
|
237 |
+
} else {
|
238 |
+
|
239 |
+
$limit = isset($data['excerpt_limit']) ? abs($data['excerpt_limit']) : 0;
|
240 |
+
$defaultExcerpt = get_the_excerpt($post_id);
|
241 |
+
$more = $data['excerpt_more_text'];
|
242 |
+
$excerpt = preg_replace('`\[[^\]]*\]`', '', $defaultExcerpt);
|
243 |
+
$excerpt = strip_shortcodes($excerpt);
|
244 |
+
$excerpt = preg_replace('`[[^]]*]`', '', $excerpt);
|
245 |
+
$excerpt = str_replace('…', '', $excerpt);
|
246 |
+
if ($limit) {
|
247 |
+
$excerpt = wp_filter_nohtml_kses($excerpt);
|
248 |
+
if ($type == "word") {
|
249 |
+
$limit = $limit + 1;
|
250 |
+
$rawExcerpt = $excerpt;
|
251 |
+
$excerpt = explode(' ', $excerpt, $limit);
|
252 |
+
if (count($excerpt) >= $limit) {
|
253 |
+
array_pop($excerpt);
|
254 |
+
$excerpt = implode(" ", $excerpt);
|
255 |
+
} else {
|
256 |
+
$excerpt = $rawExcerpt;
|
257 |
+
}
|
258 |
+
} else {
|
259 |
+
if ($limit > 0 && strlen($excerpt) > $limit) {
|
260 |
+
$excerpt = mb_substr($excerpt, 0, $limit, "utf-8");
|
261 |
+
$excerpt = preg_replace('/\W\w+\s*(\W*)$/', '$1', $excerpt);
|
262 |
+
}
|
263 |
+
}
|
264 |
+
} else {
|
265 |
+
$allowed_html = array(
|
266 |
+
'a' => array(
|
267 |
+
'href' => array(),
|
268 |
+
'title' => array()
|
269 |
+
),
|
270 |
+
'strong' => array(),
|
271 |
+
'b' => array(),
|
272 |
+
'br' => array(array()),
|
273 |
+
);
|
274 |
+
$excerpt = nl2br(wp_kses($excerpt, $allowed_html));
|
275 |
+
}
|
276 |
+
$excerpt = ($more ? $excerpt . " " . $more : $excerpt);
|
277 |
+
|
278 |
+
|
279 |
+
return apply_filters('tpg_get_the_excerpt', $excerpt, $post_id, $data, $defaultExcerpt);
|
280 |
+
}
|
281 |
+
}
|
282 |
+
|
283 |
+
|
284 |
+
function rt_pagination($pages = '', $range = 4) {
|
285 |
+
|
286 |
+
$html = null;
|
287 |
+
$showitems = ($range * 2) + 1;
|
288 |
+
global $paged;
|
289 |
+
if (empty($paged)) {
|
290 |
+
if (get_query_var('paged')) {
|
291 |
+
$paged = get_query_var('paged');
|
292 |
+
} elseif (get_query_var('page')) {
|
293 |
+
$paged = get_query_var('page');
|
294 |
+
} else {
|
295 |
+
$paged = 1;
|
296 |
+
}
|
297 |
+
}
|
298 |
+
if ($pages == '') {
|
299 |
+
global $wp_query;
|
300 |
+
$pages = $wp_query->max_num_pages;
|
301 |
+
if (!$pages) {
|
302 |
+
$pages = 1;
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
if (1 != $pages) {
|
307 |
+
|
308 |
+
$html .= '<div class="rt-pagination">';
|
309 |
+
$html .= '<ul class="pagination">';
|
310 |
+
|
311 |
+
if ($paged > 1 && $showitems < $pages) {
|
312 |
+
$html .= "<li><a href='" . get_pagenum_link($paged - 1) . "' aria-label='Previous'><i class='fa fa-chevron-left' aria-hidden='true'></i></a></li>";
|
313 |
+
}
|
314 |
+
|
315 |
+
for ($i = 1; $i <= $pages; $i++) {
|
316 |
+
|
317 |
+
if (1 != $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) {
|
318 |
+
$html .= ($paged == $i) ? "<li class='active'><span>" . $i . "</span></li>" : "<li><a href='" . get_pagenum_link($i) . "'>" . $i . "</a></li>";
|
319 |
+
|
320 |
+
}
|
321 |
+
|
322 |
+
}
|
323 |
+
|
324 |
+
if ($paged < $pages && $showitems < $pages) {
|
325 |
+
$html .= "<li><a href='" . get_pagenum_link($paged + 1) . "' aria-label='Next'><i class='fa fa-chevron-right' aria-hidden='true'></i></a></li>";
|
326 |
+
}
|
327 |
+
|
328 |
+
$html .= "</ul>";
|
329 |
+
$html .= "</div>";
|
330 |
+
}
|
331 |
+
|
332 |
+
return $html;
|
333 |
+
|
334 |
+
}
|
335 |
+
|
336 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
|
338 |
endif;
|
lib/classes/rtTPGMeta.php
CHANGED
@@ -8,6 +8,7 @@ if (!class_exists('rtTPGMeta')):
|
|
8 |
// actions
|
9 |
add_action('admin_head', array($this, 'admin_head'));
|
10 |
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
|
|
11 |
add_action('save_post', array($this, 'save_post'), 10, 2);
|
12 |
add_filter('manage_edit-rttpg_columns', array($this, 'arrange_rttpg_columns'));
|
13 |
add_action('manage_rttpg_posts_custom_column', array($this, 'manage_rttpg_columns'), 10, 2);
|
@@ -50,10 +51,7 @@ if (!class_exists('rtTPGMeta')):
|
|
50 |
'jquery-ui-core',
|
51 |
'rt-fontawsome',
|
52 |
'rt-actual-height-js',
|
53 |
-
'jquery-ui-tabs',
|
54 |
'wp-color-picker',
|
55 |
-
'ace_code_highlighter_js',
|
56 |
-
'ace_mode_js',
|
57 |
'rt-select2-js',
|
58 |
'rt-tpg',
|
59 |
'rt-tpg-admin',
|
@@ -87,13 +85,6 @@ if (!class_exists('rtTPGMeta')):
|
|
87 |
rtTPG()->post_type,
|
88 |
'normal',
|
89 |
'high');
|
90 |
-
add_meta_box(
|
91 |
-
'rttpg_meta_marketing',
|
92 |
-
__('Pro Features'),
|
93 |
-
array($this, 'rttpg_meta_marketing_selection'),
|
94 |
-
rtTPG()->post_type,
|
95 |
-
'side',
|
96 |
-
'default');
|
97 |
add_meta_box(
|
98 |
rtTPG()->post_type . '_sc_preview_meta',
|
99 |
__('Layout Preview', 'the-post-grid'),
|
@@ -101,7 +92,49 @@ if (!class_exists('rtTPGMeta')):
|
|
101 |
rtTPG()->post_type,
|
102 |
'normal',
|
103 |
'high');
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
}
|
106 |
|
107 |
|
@@ -136,28 +169,28 @@ if (!class_exists('rtTPGMeta')):
|
|
136 |
);
|
137 |
wp_nonce_field(rtTPG()->nonceText(), rtTPG()->nonceId());
|
138 |
$html = null;
|
139 |
-
$html .= '<div id="sc-tabs" class="rt-
|
140 |
$html .= '<ul class="rt-tab-nav">
|
141 |
-
<li><a href="#sc-post-post-source">' . __('Post Source', 'the-post-grid') . '</a></li>
|
142 |
<li><a href="#sc-post-layout-settings">' . __('Layout Settings', 'the-post-grid') . '</a></li>
|
143 |
<li><a href="#sc-field-selection">' . __('Field Selection', 'the-post-grid') . '</a></li>
|
144 |
<li><a href="#sc-style">' . __('Style', 'the-post-grid') . '</a></li>
|
145 |
</ul>';
|
146 |
|
147 |
|
148 |
-
$html .= '<div id="sc-post-post-source" class="rt-tab-
|
149 |
$html .= rtTPG()->render('settings.post-source', $post, true);
|
150 |
$html .= '</div>';
|
151 |
|
152 |
-
$html .= '<div id="sc-post-layout-settings" class="rt-tab-
|
153 |
$html .= rtTPG()->render('settings.layout-settings', $post, true);
|
154 |
$html .= '</div>';
|
155 |
|
156 |
-
$html .= '<div id="sc-field-selection" class="rt-tab-
|
157 |
$html .= rtTPG()->render('settings.item-fields', $post, true);
|
158 |
$html .= '</div>';
|
159 |
|
160 |
-
$html .= '<div id="sc-style" class="rt-tab-
|
161 |
$html .= rtTPG()->render('settings.style', $post, true);
|
162 |
$html .= '</div>';
|
163 |
|
8 |
// actions
|
9 |
add_action('admin_head', array($this, 'admin_head'));
|
10 |
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
11 |
+
add_action('edit_form_after_title', array($this, 'tpg_sc_after_title'));
|
12 |
add_action('save_post', array($this, 'save_post'), 10, 2);
|
13 |
add_filter('manage_edit-rttpg_columns', array($this, 'arrange_rttpg_columns'));
|
14 |
add_action('manage_rttpg_posts_custom_column', array($this, 'manage_rttpg_columns'), 10, 2);
|
51 |
'jquery-ui-core',
|
52 |
'rt-fontawsome',
|
53 |
'rt-actual-height-js',
|
|
|
54 |
'wp-color-picker',
|
|
|
|
|
55 |
'rt-select2-js',
|
56 |
'rt-tpg',
|
57 |
'rt-tpg-admin',
|
85 |
rtTPG()->post_type,
|
86 |
'normal',
|
87 |
'high');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
add_meta_box(
|
89 |
rtTPG()->post_type . '_sc_preview_meta',
|
90 |
__('Layout Preview', 'the-post-grid'),
|
92 |
rtTPG()->post_type,
|
93 |
'normal',
|
94 |
'high');
|
95 |
+
|
96 |
+
add_meta_box(
|
97 |
+
'rt_plugin_sc_pro_information',
|
98 |
+
__('Documentation', 'the-post-grid'),
|
99 |
+
array($this, 'rt_plugin_sc_pro_information'),
|
100 |
+
rtTPG()->post_type,
|
101 |
+
'side',
|
102 |
+
'low'
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
function rt_plugin_sc_pro_information($post) {
|
107 |
+
$html = '';
|
108 |
+
if ($post === 'settings') {
|
109 |
+
$html .= '<div class="rt-document-box rt-update-pro-btn-wrap">
|
110 |
+
<a href="https://www.radiustheme.com/the-post-grid-pro-for-wordpress/" target="_blank" class="rt-update-pro-btn">' . __("Update Pro To Get More Features", "the-post-grid") . '</a>
|
111 |
+
</div>';
|
112 |
+
} else {
|
113 |
+
$html .= sprintf('<div class="rt-document-box"><div class="rt-box-icon"><i class="dashicons dashicons-megaphone"></i></div><div class="rt-box-content"><h3 class="rt-box-title">Pro Features</h3>%s</div></div>', rtTPG()->get_pro_feature_list());
|
114 |
+
}
|
115 |
+
$html .= sprintf('<div class="rt-document-box">
|
116 |
+
<div class="rt-box-icon"><i class="dashicons dashicons-media-document"></i></div>
|
117 |
+
<div class="rt-box-content">
|
118 |
+
<h3 class="rt-box-title">%1$s</h3>
|
119 |
+
<p>%2$s</p>
|
120 |
+
<a href="https://radiustheme.com/how-to-setup-configure-the-post-grid-free-version-for-wordpress/" target="_blank" class="rt-admin-btn">%1$s</a>
|
121 |
+
</div>
|
122 |
+
</div>',
|
123 |
+
__("Documentation", 'the-post-grid'),
|
124 |
+
__("Get started by spending some time with the documentation we included step by step process with screenshots with video.", 'the-post-grid')
|
125 |
+
);
|
126 |
+
|
127 |
+
$html .= '<div class="rt-document-box">
|
128 |
+
<div class="rt-box-icon"><i class="dashicons dashicons-sos"></i></div>
|
129 |
+
<div class="rt-box-content">
|
130 |
+
<h3 class="rt-box-title">Need Help?</h3>
|
131 |
+
<p>Stuck with something? Please create a
|
132 |
+
<a href="https://www.radiustheme.com/contact/">ticket here</a> or post on <a href="https://www.facebook.com/groups/234799147426640/">facebook group</a>. For emergency case join our <a href="https://www.radiustheme.com/">live chat</a>.</p>
|
133 |
+
<a href="https://www.radiustheme.com/contact/" target="_blank" class="rt-admin-btn">' . __("Get Support", "the-post-grid") . '</a>
|
134 |
+
</div>
|
135 |
+
</div>';
|
136 |
+
|
137 |
+
echo $html;
|
138 |
}
|
139 |
|
140 |
|
169 |
);
|
170 |
wp_nonce_field(rtTPG()->nonceText(), rtTPG()->nonceId());
|
171 |
$html = null;
|
172 |
+
$html .= '<div id="sc-tabs" class="rt-tab-container">';
|
173 |
$html .= '<ul class="rt-tab-nav">
|
174 |
+
<li class="active"><a href="#sc-post-post-source">' . __('Post Source', 'the-post-grid') . '</a></li>
|
175 |
<li><a href="#sc-post-layout-settings">' . __('Layout Settings', 'the-post-grid') . '</a></li>
|
176 |
<li><a href="#sc-field-selection">' . __('Field Selection', 'the-post-grid') . '</a></li>
|
177 |
<li><a href="#sc-style">' . __('Style', 'the-post-grid') . '</a></li>
|
178 |
</ul>';
|
179 |
|
180 |
|
181 |
+
$html .= '<div id="sc-post-post-source" class="rt-tab-content" style="display: block">';
|
182 |
$html .= rtTPG()->render('settings.post-source', $post, true);
|
183 |
$html .= '</div>';
|
184 |
|
185 |
+
$html .= '<div id="sc-post-layout-settings" class="rt-tab-content">';
|
186 |
$html .= rtTPG()->render('settings.layout-settings', $post, true);
|
187 |
$html .= '</div>';
|
188 |
|
189 |
+
$html .= '<div id="sc-field-selection" class="rt-tab-content">';
|
190 |
$html .= rtTPG()->render('settings.item-fields', $post, true);
|
191 |
$html .= '</div>';
|
192 |
|
193 |
+
$html .= '<div id="sc-style" class="rt-tab-content">';
|
194 |
$html .= rtTPG()->render('settings.style', $post, true);
|
195 |
$html .= '</div>';
|
196 |
|
lib/classes/rtTPGOptions.php
CHANGED
@@ -1,470 +1,513 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (
|
4 |
|
5 |
-
|
|
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
|
164 |
-
|
165 |
-
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
|
330 |
-
|
331 |
-
|
332 |
|
333 |
-
|
334 |
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
|
403 |
-
|
404 |
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
|
452 |
-
|
453 |
-
|
454 |
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
|
468 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
|
470 |
endif;
|
1 |
<?php
|
2 |
|
3 |
+
if (!class_exists('rtTPGOptions')):
|
4 |
|
5 |
+
class rtTPGOptions
|
6 |
+
{
|
7 |
|
8 |
+
function rtPostTypes() {
|
9 |
+
$post_types = get_post_types(
|
10 |
+
array(
|
11 |
+
'_builtin' => true
|
12 |
+
)
|
13 |
+
);
|
14 |
+
$exclude = array('attachment', 'revision', 'nav_menu_item');
|
15 |
+
foreach ($exclude as $ex) {
|
16 |
+
unset($post_types[$ex]);
|
17 |
+
}
|
18 |
|
19 |
+
return $post_types;
|
20 |
+
}
|
21 |
|
22 |
+
function rtPostOrders() {
|
23 |
+
return array(
|
24 |
+
"ASC" => "Ascending",
|
25 |
+
"DESC" => "Descending",
|
26 |
+
);
|
27 |
+
}
|
28 |
|
29 |
+
function rtTermOperators() {
|
30 |
+
return array(
|
31 |
+
'IN' => "IN — show posts which associate with one or more of selected terms",
|
32 |
+
'NOT IN' => "NOT IN — show posts which do not associate with any of selected terms",
|
33 |
+
'AND' => "AND — show posts which associate with all of selected terms",
|
34 |
+
);
|
35 |
+
}
|
36 |
|
37 |
+
function rtTermRelations() {
|
38 |
+
return array(
|
39 |
+
'AND' => "AND — show posts which match all settings",
|
40 |
+
'OR' => "OR — show posts which match one or more settings",
|
41 |
+
);
|
42 |
+
}
|
43 |
|
44 |
+
function rtPostOrderBy() {
|
45 |
+
return array(
|
46 |
+
"ID" => "ID",
|
47 |
+
"title" => "Title",
|
48 |
+
"date" => "Created date",
|
49 |
+
"modified" => "Modified date",
|
50 |
+
"menu_order" => "Menu Order"
|
51 |
+
);
|
52 |
+
}
|
53 |
|
54 |
+
function rtTPGSettingFields() {
|
55 |
+
global $rtTPG;
|
56 |
+
$settings = get_option($rtTPG->options['settings']);
|
57 |
|
58 |
+
return array(
|
59 |
+
'custom_css' => array(
|
60 |
+
'type' => 'textarea',
|
61 |
+
'name' => 'custom_css',
|
62 |
+
'label' => 'Custom Css',
|
63 |
+
'holderClass' => 'rt-script-wrapper full',
|
64 |
+
'id' => 'custom-css',
|
65 |
+
'value' => isset($settings['custom_css']) ? stripslashes($settings['custom_css']) : null,
|
66 |
+
),
|
67 |
+
"script_before_item_load" => array(
|
68 |
+
'name' => 'script_before_item_load',
|
69 |
+
"label" => __("Script before item load", 'the-post-grid'),
|
70 |
+
'type' => 'textarea',
|
71 |
+
'holderClass' => 'rt-script-wrapper full',
|
72 |
+
'id' => 'script-before-item-load',
|
73 |
+
'value' => isset($settings['script_before_item_load']) ? stripslashes($settings['script_before_item_load']) : null
|
74 |
+
),
|
75 |
+
"script_after_item_load" => array(
|
76 |
+
'name' => 'script_after_item_load',
|
77 |
+
"label" => __("Script After item load", 'the-post-grid'),
|
78 |
+
'type' => 'textarea',
|
79 |
+
'holderClass' => 'rt-script-wrapper full',
|
80 |
+
'id' => 'script-after-item-load',
|
81 |
+
'value' => isset($settings['script_after_item_load']) ? stripslashes($settings['script_after_item_load']) : null
|
82 |
+
),
|
83 |
+
"script_loaded" => array(
|
84 |
+
'name' => 'script_loaded',
|
85 |
+
"label" => __("After Loaded Script", 'the-post-grid'),
|
86 |
+
'type' => 'textarea',
|
87 |
+
'holderClass' => 'rt-script-wrapper full',
|
88 |
+
'id' => 'script-loaded',
|
89 |
+
'value' => isset($settings['script_loaded']) ? stripslashes($settings['script_loaded']) : null
|
90 |
+
)
|
91 |
+
);
|
92 |
+
}
|
93 |
|
94 |
+
function rtTPGCommonFilterFields() {
|
95 |
+
return array(
|
96 |
+
'post__in' => array(
|
97 |
+
"name" => "post__in",
|
98 |
+
"label" => "Include only",
|
99 |
+
"type" => "text",
|
100 |
+
"class" => "full",
|
101 |
+
"description" => __('List of post IDs to show (comma-separated values, for example: 1,2,3)',
|
102 |
+
'the-post-grid')
|
103 |
+
),
|
104 |
+
'post__not_in' => array(
|
105 |
+
"name" => "post__not_in",
|
106 |
+
"label" => "Exclude",
|
107 |
+
"type" => "text",
|
108 |
+
"class" => "full",
|
109 |
+
"description" => __('List of post IDs to hide (comma-separated values, for example: 1,2,3)',
|
110 |
+
'the-post-grid')
|
111 |
+
),
|
112 |
+
'limit' => array(
|
113 |
+
"name" => "limit",
|
114 |
+
"label" => "Limit",
|
115 |
+
"type" => "number",
|
116 |
+
"class" => "full",
|
117 |
+
"description" => __('The number of posts to show. Set empty to show all found posts.',
|
118 |
+
'the-post-grid')
|
119 |
+
)
|
120 |
+
);
|
121 |
+
}
|
122 |
|
123 |
+
function rtTPGPostType() {
|
124 |
+
return array(
|
125 |
+
"name" => "tpg_post_type",
|
126 |
+
"label" => "Post Type",
|
127 |
+
"type" => "select",
|
128 |
+
"id" => "rc-sc-post-type",
|
129 |
+
"class" => "rt-select2",
|
130 |
+
"options" => $this->rtPostTypes()
|
131 |
+
);
|
132 |
+
}
|
133 |
|
134 |
+
function rtTPAdvanceFilters() {
|
135 |
+
return array(
|
136 |
+
'type' => "checkbox",
|
137 |
+
'name' => "post_filter",
|
138 |
+
'label' => "Advanced filters",
|
139 |
+
'id' => "post_filter",
|
140 |
+
"alignment" => "vertical",
|
141 |
+
"multiple" => true,
|
142 |
+
"options" => array(
|
143 |
+
'tpg_taxonomy' => "Taxonomy",
|
144 |
+
'order' => "Order",
|
145 |
+
'author' => "Author",
|
146 |
+
'tpg_post_status' => "Status",
|
147 |
+
's' => "Search"
|
148 |
+
),
|
149 |
+
);
|
150 |
+
}
|
151 |
|
152 |
+
function rtTPGPostStatus() {
|
153 |
+
return array(
|
154 |
+
'publish' => 'Publish',
|
155 |
+
'pending' => 'Pending',
|
156 |
+
'draft' => 'Draft',
|
157 |
+
'auto-draft' => 'Auto draft',
|
158 |
+
'future' => 'Future',
|
159 |
+
'private' => 'Private',
|
160 |
+
'inherit' => 'Inherit',
|
161 |
+
'trash' => 'Trash',
|
162 |
+
);
|
163 |
+
}
|
164 |
|
165 |
+
function rtTPGLayoutSettingFields() {
|
166 |
+
global $rtTPG;
|
167 |
|
168 |
+
return array(
|
169 |
+
'layout' => array(
|
170 |
+
"type" => "select",
|
171 |
+
"name" => "layout",
|
172 |
+
"label" => "Layout",
|
173 |
+
"id" => "rt-tpg-sc-layout",
|
174 |
+
"class" => "rt-select2",
|
175 |
+
"options" => $this->rtTPGLayouts()
|
176 |
+
),
|
177 |
+
'isotope-filtering' => array(
|
178 |
+
"type" => "select",
|
179 |
+
"name" => "isotope_filter",
|
180 |
+
"label" => "Isotope Filter",
|
181 |
+
'holderClass' => "sc-isotope-filter tpg-hidden",
|
182 |
+
"id" => "rt-tpg-sc-isotope-filter",
|
183 |
+
"class" => "rt-select2",
|
184 |
+
"options" => $rtTPG->rt_get_taxonomy_for_isotope_filter()
|
185 |
+
),
|
186 |
+
'tpg_show_all_text' => array(
|
187 |
+
"type" => "text",
|
188 |
+
"name" => "tpg_show_all_text",
|
189 |
+
'holderClass' => "sc-isotope-filter tpg-hidden",
|
190 |
+
"label" => esc_html__("Show all text", 'the-post-grid'),
|
191 |
+
"default" => esc_html__("Show all", 'the-post-grid')
|
192 |
+
),
|
193 |
+
'tgp_layout2_image_column' => array(
|
194 |
+
'type' => 'select',
|
195 |
+
"name" => "tgp_layout2_image_column",
|
196 |
+
"id" => "tgp_layout2_image_column",
|
197 |
+
'label' => __('Image column', 'the-post-grid'),
|
198 |
+
'class' => 'rt-select2',
|
199 |
+
'holderClass' => "holder-layout2-image-column tpg-hidden",
|
200 |
+
'default' => 4,
|
201 |
+
'options' => $this->rtTPGColumns(),
|
202 |
+
"description" => "Content column will calculate automatically"
|
203 |
+
),
|
204 |
+
'column' => array(
|
205 |
+
"type" => "select",
|
206 |
+
"name" => "column",
|
207 |
+
"label" => "Column",
|
208 |
+
"id" => "rt-column",
|
209 |
+
"class" => "rt-select2",
|
210 |
+
"default" => 4,
|
211 |
+
"options" => $this->rtTPGColumns()
|
212 |
+
),
|
213 |
+
'pagination' => array(
|
214 |
+
"type" => "checkbox",
|
215 |
+
"name" => "pagination",
|
216 |
+
"label" => "Pagination",
|
217 |
+
'holderClass' => "pagination",
|
218 |
+
"id" => "rt-tpg-pagination",
|
219 |
+
"option" => 'Enable'
|
220 |
+
),
|
221 |
+
'posts_per_page' => array(
|
222 |
+
"type" => "number",
|
223 |
+
"name" => "posts_per_page",
|
224 |
+
"label" => "Display per page",
|
225 |
+
'holderClass' => "posts-per-page tpg-hidden",
|
226 |
+
"id" => "posts-per-page",
|
227 |
+
"default" => 5,
|
228 |
+
"description" => __("If value of Limit setting is not blank (empty), this value should be smaller than Limit value.",
|
229 |
+
'the-post-grid')
|
230 |
+
),
|
231 |
+
'featured_image' => array(
|
232 |
+
"type" => "checkbox",
|
233 |
+
"name" => "featured_image",
|
234 |
+
"label" => "Feature Image",
|
235 |
+
"id" => "rt-feature-image",
|
236 |
+
"option" => 'Disable'
|
237 |
+
),
|
238 |
+
'featured_image_size' => array(
|
239 |
+
"type" => "select",
|
240 |
+
"name" => "featured_image_size",
|
241 |
+
"label" => "Feature Image Size",
|
242 |
+
"id" => "featured-image-size",
|
243 |
+
'holderClass' => "feature-image-options tpg-hidden",
|
244 |
+
"class" => "rt-select2",
|
245 |
+
"options" => $rtTPG->get_image_sizes()
|
246 |
+
),
|
247 |
+
'media_source' => array(
|
248 |
+
"type" => "radio",
|
249 |
+
"name" => "media_source",
|
250 |
+
"label" => "Media Source",
|
251 |
+
"id" => "media-source",
|
252 |
+
'holderClass' => "feature-image-options tpg-hidden",
|
253 |
+
"default" => 'feature_image',
|
254 |
+
"alignment" => "vertical",
|
255 |
+
"options" => $this->rtMediaSource()
|
256 |
+
),
|
257 |
+
'tpg_title_limit' => array(
|
258 |
+
"name" => "tpg_title_limit",
|
259 |
+
"id" => "tpg-title-limit",
|
260 |
+
"type" => "number",
|
261 |
+
"label" => esc_html__("Title limit", 'the-post-grid'),
|
262 |
+
"description" => esc_html__("Title limit only integer number is allowed, Leave it blank for full title.", 'the-post-grid')
|
263 |
+
),
|
264 |
+
'tpg_title_limit_type' => array(
|
265 |
+
"name" => "tpg_title_limit_type",
|
266 |
+
"id" => "tpg-title-limit-type",
|
267 |
+
"type" => "radio",
|
268 |
+
"label" => esc_html__("Title limit type", 'the-post-grid'),
|
269 |
+
"alignment" => "vertical",
|
270 |
+
"default" => 'character',
|
271 |
+
"options" => $this->get_limit_type(),
|
272 |
+
),
|
273 |
+
'excerpt_limit' => array(
|
274 |
+
"type" => "number",
|
275 |
+
"name" => "excerpt_limit",
|
276 |
+
"label" => esc_html__("Excerpt limit", 'the-post-grid'),
|
277 |
+
"id" => "excerpt-limit",
|
278 |
+
"description" => __("Excerpt limit only integer number is allowed, Leave it blank for full excerpt. Note: This will remove all html tag",
|
279 |
+
'the-post-grid')
|
280 |
+
),
|
281 |
+
'tgp_excerpt_type' => array(
|
282 |
+
"type" => "radio",
|
283 |
+
"label" => esc_html__("Excerpt Type", 'the-post-grid'),
|
284 |
+
"name" => "tgp_excerpt_type",
|
285 |
+
"id" => "tgp_excerpt_type",
|
286 |
+
"alignment" => "vertical",
|
287 |
+
"default" => 'character',
|
288 |
+
"options" => $this->get_limit_type('content'),
|
289 |
+
),
|
290 |
+
'tgp_excerpt_more_text' => array(
|
291 |
+
"type" => "text",
|
292 |
+
"label" => esc_html__("Excerpt more text", 'the-post-grid'),
|
293 |
+
"name" => "tgp_excerpt_more_text",
|
294 |
+
"id" => "tgp_excerpt_more_text",
|
295 |
+
"default" => "..."
|
296 |
+
),
|
297 |
+
'tgp_read_more_text' => array(
|
298 |
+
"type" => "text",
|
299 |
+
"label" => esc_html__("Read more text", 'the-post-grid'),
|
300 |
+
"name" => "tgp_read_more_text",
|
301 |
+
"id" => "tgp_read_more_text",
|
302 |
+
),
|
303 |
+
'tpg_overlay' => array(
|
304 |
+
"type" => "checkbox",
|
305 |
+
"name" => "tpg_overlay",
|
306 |
+
"label" => esc_html__("Overlay", 'the-post-grid'),
|
307 |
+
"id" => "tpg_overlay",
|
308 |
+
"option" => 'Enable'
|
309 |
+
),
|
310 |
+
'title_tag' => array(
|
311 |
+
'type' => 'select',
|
312 |
+
'name' => 'title_tag',
|
313 |
+
'label' => esc_html__('Title tag', 'the-post-grid'),
|
314 |
+
'class' => 'rt-select2',
|
315 |
+
'id' => 'title-tag',
|
316 |
+
'options' => $this->getTitleTags(),
|
317 |
+
'default' => 'h2'
|
318 |
+
),
|
319 |
+
'link_to_detail_page' => array(
|
320 |
+
"type" => "radio",
|
321 |
+
'name' => 'link_to_detail_page',
|
322 |
+
"label" => esc_html__("Link To Detail Page", 'the-post-grid'),
|
323 |
+
"alignment" => "vertical",
|
324 |
+
"default" => 'yes',
|
325 |
+
"options" => array(
|
326 |
+
'yes' => 'Yes',
|
327 |
+
'no' => 'No'
|
328 |
+
)
|
329 |
+
),
|
330 |
+
'link_target' => array(
|
331 |
+
"type" => "radio",
|
332 |
+
"name" => "link_target",
|
333 |
+
"label" => esc_html__("Link Target", 'the-post-grid'),
|
334 |
+
'holderClass' => "tpg-link-target tpg-hidden",
|
335 |
+
"alignment" => 'vertical',
|
336 |
+
"options" => array(
|
337 |
+
'' => 'Same Window',
|
338 |
+
'_blank' => 'New Window'
|
339 |
+
)
|
340 |
+
),
|
341 |
+
);
|
342 |
+
}
|
343 |
|
344 |
+
function get_limit_type($content = null) {
|
345 |
+
$types = array(
|
346 |
+
'character' => __("Character", "the-post-grid"),
|
347 |
+
'word' => __("Word", "the-post-grid")
|
348 |
+
);
|
349 |
+
if ($content === 'content') {
|
350 |
+
$types['full'] = __("Full Content", "the-post-grid");
|
351 |
+
}
|
352 |
|
353 |
+
return apply_filters('tpg_limit_type', $types, $content);
|
354 |
+
}
|
355 |
|
356 |
+
function rtTPGStyleFields() {
|
357 |
|
358 |
+
return array(
|
359 |
+
'parent_class' => array(
|
360 |
+
"name" => "parent_class",
|
361 |
+
"type" => "text",
|
362 |
+
"label" => "Parent class",
|
363 |
+
"class" => "medium-text",
|
364 |
+
"description" => "Parent class for adding custom css"
|
365 |
+
),
|
366 |
+
'primary_color' => array(
|
367 |
+
"type" => "text",
|
368 |
+
"name" => "primary_color",
|
369 |
+
"label" => "Primary Color",
|
370 |
+
"id" => "primary-color",
|
371 |
+
"class" => "rt-color",
|
372 |
+
"default" => "#0367bf"
|
373 |
+
),
|
374 |
+
'button_bg_color' => array(
|
375 |
+
"type" => "text",
|
376 |
+
"name" => "button_bg_color",
|
377 |
+
"label" => "Button background color",
|
378 |
+
"id" => "button-bg-color",
|
379 |
+
"class" => "rt-color"
|
380 |
+
),
|
381 |
+
'button_hover_bg_color' => array(
|
382 |
+
"type" => "text",
|
383 |
+
"name" => "button_hover_bg_color",
|
384 |
+
"label" => "Button hover background color",
|
385 |
+
"id" => "button-hover-bg-color",
|
386 |
+
"class" => "rt-color"
|
387 |
+
),
|
388 |
+
'button_active_bg_color' => array(
|
389 |
+
"type" => "text",
|
390 |
+
"name" => "button_active_bg_color",
|
391 |
+
"label" => "Button active background color",
|
392 |
+
"id" => "button-active-bg-color",
|
393 |
+
"class" => "rt-color"
|
394 |
+
),
|
395 |
+
'button_text_bg_color' => array(
|
396 |
+
"type" => "text",
|
397 |
+
"name" => "button_text_color",
|
398 |
+
"label" => "Button text color",
|
399 |
+
"id" => "button-text-color",
|
400 |
+
"class" => "rt-color"
|
401 |
+
),
|
402 |
+
'title_color' => array(
|
403 |
+
"type" => "text",
|
404 |
+
"name" => "title_color",
|
405 |
+
"label" => esc_html__("Title color", "the-post-grid"),
|
406 |
+
"id" => "title_color",
|
407 |
+
"class" => "rt-color"
|
408 |
+
),
|
409 |
+
'title_hover_color' => array(
|
410 |
+
"type" => "text",
|
411 |
+
"name" => "title_hover_color",
|
412 |
+
"label" => esc_html__("Title hover color", "the-post-grid"),
|
413 |
+
"id" => "title_hover_color",
|
414 |
+
"class" => "rt-color"
|
415 |
+
),
|
416 |
+
'tpg_read_more_button_border_radius' => array(
|
417 |
+
"type" => "number",
|
418 |
+
"name" => "tpg_read_more_button_border_radius",
|
419 |
+
"id" => "tpg-read-more-button-border-radius",
|
420 |
+
"class" => "small-text",
|
421 |
+
"label" => esc_html__("Read more button border radius", "the-post-grid"),
|
422 |
+
"description" => esc_html__("Leave it blank for default", 'the-post-grid')
|
423 |
+
)
|
424 |
+
);
|
425 |
|
426 |
+
}
|
427 |
|
428 |
+
function getTitleTags() {
|
429 |
+
return array(
|
430 |
+
'h2' => "H2",
|
431 |
+
'h3' => "H3",
|
432 |
+
'h4' => "H4"
|
433 |
+
);
|
434 |
+
}
|
435 |
|
436 |
+
function itemFields() {
|
437 |
+
return array(
|
438 |
+
"type" => "checkbox",
|
439 |
+
"name" => "item_fields",
|
440 |
+
"label" => "Field selection",
|
441 |
+
"id" => "item-fields",
|
442 |
+
"multiple" => true,
|
443 |
+
"alignment" => "vertical",
|
444 |
+
"default" => array_keys($this->rtTPGItemFields()),
|
445 |
+
"options" => $this->rtTPGItemFields()
|
446 |
+
);
|
447 |
+
}
|
448 |
|
449 |
+
function rtMediaSource() {
|
450 |
+
return array(
|
451 |
+
"feature_image" => __("Feature Image", 'the-post-grid'),
|
452 |
+
"first_image" => __("First Image from content", 'the-post-grid')
|
453 |
+
);
|
454 |
+
}
|
455 |
|
456 |
+
function rtTPGColumns() {
|
457 |
+
return array(
|
458 |
+
1 => "Column 1",
|
459 |
+
2 => "Column 2",
|
460 |
+
3 => "Column 3",
|
461 |
+
4 => "Column 4",
|
462 |
+
5 => "Column 5",
|
463 |
+
6 => "Column 6"
|
464 |
+
);
|
465 |
+
}
|
466 |
|
467 |
+
function rtTPGLayouts() {
|
468 |
+
$layouts = array(
|
469 |
+
'layout1' => "Layout 1",
|
470 |
+
'layout2' => "Layout 2",
|
471 |
+
'layout3' => "Layout 3",
|
472 |
+
'isotope1' => "Isotope Layout"
|
473 |
+
);
|
474 |
|
475 |
+
return apply_filters('tpg_layouts', $layouts);
|
476 |
+
}
|
477 |
|
478 |
+
function rtTPGItemFields() {
|
479 |
+
return array(
|
480 |
+
'title' => __("Title", 'the-post-grid'),
|
481 |
+
'excerpt' => __("Excerpt", 'the-post-grid'),
|
482 |
+
'read_more' => __("Read More", 'the-post-grid'),
|
483 |
+
'post_date' => __("Post Date", 'the-post-grid'),
|
484 |
+
'author' => __("Author", 'the-post-grid'),
|
485 |
+
'categories' => __("Categories", 'the-post-grid'),
|
486 |
+
'tags' => __("Tags", 'the-post-grid'),
|
487 |
+
'comment_count' => __("Comment Count", 'the-post-grid')
|
488 |
+
);
|
489 |
+
}
|
490 |
|
491 |
+
function get_pro_feature_list() {
|
492 |
+
return '<ol>
|
493 |
+
<li>Fully responsive and mobile friendly.</li>
|
494 |
+
<li>55 Different Layouts</li>
|
495 |
+
<li>Even and Masonry Grid.</li>
|
496 |
+
<li>WooCommerce supported.</li>
|
497 |
+
<li>Custom Post Type Supported</li>
|
498 |
+
<li>Display posts by any Taxonomy like category(s), tag(s), author(s), keyword(s)</li>
|
499 |
+
<li>Order by Id, Title, Created date, Modified date and Menu order.</li>
|
500 |
+
<li>Display image size (thumbnail, medium, large, full)</li>
|
501 |
+
<li>Isotope filter for any taxonomy ie. categories, tags...</li>
|
502 |
+
<li>Query Post with Relation.</li>
|
503 |
+
<li>Fields Selection.</li>
|
504 |
+
<li>All Text and Color control.</li>
|
505 |
+
<li>Enable/Disable Pagination.</li>
|
506 |
+
<li>AJAX Pagination (Load more and Load on Scrolling)</li>
|
507 |
+
</ol>
|
508 |
+
<a href="https://www.radiustheme.com/the-post-grid-pro-for-wordpress/" class="rt-admin-btn" target="_blank">' . __("Get Pro Version", "the-post-grid") . '</a>';
|
509 |
+
}
|
510 |
+
|
511 |
+
}
|
512 |
|
513 |
endif;
|
lib/classes/rtTPGShortCode.php
CHANGED
@@ -1,481 +1,487 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
<button data-filter="*" class="selected">' . $arg['show_all_text'] . '</button>';
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
#{$layout} .rt-detail .post-meta-user a,
|
420 |
#{$layout} .rt-detail .post-meta-category a{";
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
#{$layout} .rt-tpg-isotope-buttons button,
|
430 |
#{$layout} .rt-detail .read-more a{";
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
#{$layout} .rt-tpg-isotope-buttons button:hover,
|
437 |
#{$layout} .rt-detail .read-more a:hover{";
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
#{$layout} .rt-tpg-isotope-buttons button.selected{";
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
#{$layout} .rt-tpg-isotope-buttons button,
|
450 |
#{$layout} .rt-detail .read-more a{";
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
#{$layout} .rt-detail h3.entry-title a,
|
457 |
#{$layout} .rt-detail h4.entry-title a{";
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
#{$layout} .rt-detail h3.entry-title a:hover,
|
464 |
#{$layout} .rt-detail h4.entry-title a:hover{";
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
endif;
|
1 |
<?php
|
2 |
|
3 |
+
if (!class_exists('rtTPGShortCode')):
|
4 |
+
|
5 |
+
class rtTPGShortCode
|
6 |
+
{
|
7 |
+
|
8 |
+
private $scA = array();
|
9 |
+
|
10 |
+
function __construct() {
|
11 |
+
add_shortcode('the-post-grid', array($this, 'the_post_grid_short_code'));
|
12 |
+
add_action('wp_ajax_tpgPreviewAjaxCall', array($this, 'the_post_grid_short_code'));
|
13 |
+
}
|
14 |
+
|
15 |
+
function register_sc_scripts() {
|
16 |
+
$iso = false;
|
17 |
+
foreach ($this->scA as $sc) {
|
18 |
+
if (isset($sc) && is_array($sc)) {
|
19 |
+
if ($sc['isIsotope']) {
|
20 |
+
$iso = true;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
24 |
+
if (count($this->scA)) {
|
25 |
+
if ($iso) {
|
26 |
+
wp_enqueue_script('rt-isotope-js');
|
27 |
+
}
|
28 |
+
wp_enqueue_style('rt-fontawsome');
|
29 |
+
wp_enqueue_script('rt-actual-height-js');
|
30 |
+
wp_enqueue_script('rt-tpg');
|
31 |
+
$nonce = wp_create_nonce(rtTPG()->nonceText());
|
32 |
+
wp_localize_script('rt-tpg', 'rttpg',
|
33 |
+
array(
|
34 |
+
'nonceID' => rtTPG()->nonceId(),
|
35 |
+
'nonce' => $nonce,
|
36 |
+
'ajaxurl' => admin_url('admin-ajax.php')
|
37 |
+
));
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
function the_post_grid_short_code($atts = array(), $content = null) {
|
42 |
+
$error = true;
|
43 |
+
$html = $msg = null;
|
44 |
+
$preview = isset($_REQUEST['sc_id']) ? absint($_REQUEST['sc_id']) : 0;
|
45 |
+
$arg = array();
|
46 |
+
$atts = shortcode_atts(array(
|
47 |
+
'id' => null
|
48 |
+
), $atts, 'the-post-grid');
|
49 |
+
$scID = $atts['id'];
|
50 |
+
if ((!$preview && $scID && !is_null(get_post($scID))) || ($preview && rtTPG()->verifyNonce())) {
|
51 |
+
$rand = mt_rand();
|
52 |
+
$layoutID = "rt-tpg-container-" . $rand;
|
53 |
+
$pagination = false;
|
54 |
+
|
55 |
+
if ($preview) {
|
56 |
+
$error = false;
|
57 |
+
$scMeta = $_REQUEST;
|
58 |
+
$layout = isset($scMeta['layout']) ? $scMeta['layout'] : 'layout1';
|
59 |
+
$col = isset($scMeta['column']) ? intval($scMeta['column']) : 4;
|
60 |
+
|
61 |
+
$fImg = isset($scMeta['featured_image']) ? true : false;
|
62 |
+
$fImgSize = isset($scMeta['featured_image_size']) ? $scMeta['featured_image_size'] : "medium";
|
63 |
+
$mediaSource = isset($scMeta['media_source']) ? $scMeta['media_source'] : "feature_image";
|
64 |
+
$arg['excerpt_type'] = isset($scMeta['tgp_excerpt_type']) ? $scMeta['tgp_excerpt_type'] : 'character';
|
65 |
+
$arg['excerpt_limit'] = isset($scMeta['excerpt_limit']) ? absint($scMeta['excerpt_limit']) : 0;
|
66 |
+
$arg['excerpt_more_text'] = isset($scMeta['tgp_excerpt_more_text']) ? $scMeta['tgp_excerpt_more_text'] : null;
|
67 |
+
$arg['title_limit_type'] = isset($scMeta['tpg_title_limit_type']) ? $scMeta['tpg_title_limit_type'] : 'character';
|
68 |
+
$arg['title_limit'] = isset($scMeta['tpg_title_limit']) ? absint($scMeta['tpg_title_limit']) : 0;
|
69 |
+
$arg['read_more_text'] = isset($scMeta['tgp_read_more_text']) && !empty($scMeta['tgp_read_more_text']) ? $scMeta['tgp_read_more_text'] : __('Read More',
|
70 |
+
'the-post-grid');
|
71 |
+
$arg['show_all_text'] = isset($scMeta['tpg_show_all_text']) && !empty($scMeta['tpg_show_all_text']) ? $scMeta['tpg_show_all_text'] : __('Show all',
|
72 |
+
'the-post-grid-pro');
|
73 |
+
$postType = isset($scMeta['tpg_post_type']) ? $scMeta['tpg_post_type'] : null;
|
74 |
+
$post__in = isset($scMeta['post__in']) ? $scMeta['post__in'] : null;
|
75 |
+
$post__not_in = isset($scMeta['post__not_in']) ? $scMeta['post__not_in'] : null;
|
76 |
+
$limit = isset($scMeta['limit']) && !empty($scMeta['limit']) ? ($scMeta['limit'] == -1 ? 10000000 : (int)$scMeta['limit']) : 10000000;
|
77 |
+
$pagination = isset($scMeta['pagination']) ? $scMeta['pagination'] : false;
|
78 |
+
$posts_per_page = isset($scMeta['posts_per_page']) ? intval($scMeta['posts_per_page']) : $limit;
|
79 |
+
$order_by = isset($scMeta['order_by']) ? $scMeta['order_by'] : null;
|
80 |
+
$order = isset($scMeta['order']) ? $scMeta['order'] : null;
|
81 |
+
$s = isset($scMeta['s']) ? $scMeta['s'] : null;
|
82 |
+
$isotope_filter = isset($scMeta['isotope_filter']) ? $scMeta['isotope_filter'] : null;
|
83 |
+
$link = empty($scMeta['link_to_detail_page']) || (!empty($scMeta['link_to_detail_page']) && $scMeta['link_to_detail_page'] === "yes") ? true :false;
|
84 |
+
$link_target = !empty($scMeta['link_target']) ? $scMeta['link_target'] : null;
|
85 |
+
} else {
|
86 |
+
$scMeta = get_post_meta($scID);
|
87 |
+
$scMeta['sc_id'] = $scID;
|
88 |
+
$layout = isset($scMeta['layout'][0]) ? $scMeta['layout'][0] : 'layout1';
|
89 |
+
$col = isset($scMeta['column'][0]) ? intval($scMeta['column'][0]) : 4;
|
90 |
+
|
91 |
+
$fImg = isset($scMeta['featured_image'][0]) ? true : false;
|
92 |
+
$fImgSize = isset($scMeta['featured_image_size'][0]) ? $scMeta['featured_image_size'][0] : "medium";
|
93 |
+
$mediaSource = isset($scMeta['media_source'][0]) ? $scMeta['media_source'][0] : "feature_image";
|
94 |
+
$arg['excerpt_type'] = isset($scMeta['tgp_excerpt_type'][0]) ? $scMeta['tgp_excerpt_type'][0] : 'character';
|
95 |
+
$arg['excerpt_limit'] = isset($scMeta['excerpt_limit'][0]) ? absint($scMeta['excerpt_limit'][0]) : 0;
|
96 |
+
$arg['excerpt_more_text'] = isset($scMeta['tgp_excerpt_more_text'][0]) ? $scMeta['tgp_excerpt_more_text'][0] : null;
|
97 |
+
$arg['title_limit_type'] = isset($scMeta['tpg_title_limit_type'][0]) ? $scMeta['tpg_title_limit_type'][0] : 'character';
|
98 |
+
$arg['title_limit'] = isset($scMeta['tpg_title_limit'][0]) ? absint($scMeta['tpg_title_limit'][0]) : 0;
|
99 |
+
$arg['read_more_text'] = isset($scMeta['tgp_read_more_text'][0]) && !empty($scMeta['tgp_read_more_text'][0]) ? $scMeta['tgp_read_more_text'][0] : __('Read More',
|
100 |
+
'the-post-grid');
|
101 |
+
$arg['show_all_text'] = (!empty($scMeta['tpg_show_all_text'][0]) ? $scMeta['tpg_show_all_text'][0] : __('Show all',
|
102 |
+
'the-post-grid-pro'));
|
103 |
+
|
104 |
+
$postType = isset($scMeta['tpg_post_type'][0]) ? $scMeta['tpg_post_type'][0] : null;
|
105 |
+
$post__in = isset($scMeta['post__in'][0]) ? $scMeta['post__in'][0] : null;
|
106 |
+
$post__not_in = isset($scMeta['post__not_in'][0]) ? $scMeta['post__not_in'][0] : null;
|
107 |
+
$limit = isset($scMeta['limit'][0]) && !empty($scMeta['limit'][0]) ? ($scMeta['limit'][0] == -1 ? 10000000 : (int)$scMeta['limit'][0]) : 10000000;
|
108 |
+
$pagination = isset($scMeta['pagination'][0]) ? $scMeta['pagination'][0] : false;
|
109 |
+
$posts_per_page = isset($scMeta['posts_per_page'][0]) ? intval($scMeta['posts_per_page'][0]) : $limit;
|
110 |
+
$order_by = isset($scMeta['order_by'][0]) ? $scMeta['order_by'][0] : null;
|
111 |
+
$order = isset($scMeta['order'][0]) ? $scMeta['order'][0] : null;
|
112 |
+
$s = isset($scMeta['s'][0]) ? $scMeta['s'][0] : null;
|
113 |
+
$isotope_filter = isset($scMeta['isotope_filter'][0]) ? $scMeta['isotope_filter'][0] : null;
|
114 |
+
$link = empty($scMeta['link_to_detail_page'][0]) || (!empty($scMeta['link_to_detail_page'][0]) && $scMeta['link_to_detail_page'][0] === "yes") ? true :false;
|
115 |
+
$link_target = !empty($scMeta['link_target'][0]) ? $scMeta['link_target'][0] : null;
|
116 |
+
|
117 |
+
}
|
118 |
+
if (!in_array($layout, array_keys(rtTPG()->rtTPGLayouts()))) {
|
119 |
+
$layout = 'layout1';
|
120 |
+
}
|
121 |
+
if (!in_array($col, array_keys(rtTPG()->rtTPGColumns()))) {
|
122 |
+
$col = 4;
|
123 |
+
}
|
124 |
+
|
125 |
+
$isIsotope = preg_match('/isotope/', $layout);
|
126 |
+
|
127 |
+
/* Argument create */
|
128 |
+
$args = array();
|
129 |
+
$itemIdsArgs = array();
|
130 |
+
if ($postType) {
|
131 |
+
$args['post_type'] = $itemIdsArgs['post_type'] = $postType;
|
132 |
+
}
|
133 |
+
|
134 |
+
// Common filter
|
135 |
+
/* post__in */
|
136 |
+
if ($post__in) {
|
137 |
+
$post__in = explode(',', $post__in);
|
138 |
+
$args['post__in'] = $itemIdsArgs['post__in'] = $post__in;
|
139 |
+
}
|
140 |
+
/* post__not_in */
|
141 |
+
if ($post__not_in) {
|
142 |
+
$post__not_in = explode(',', $post__not_in);
|
143 |
+
$args['post__not_in'] = $itemIdsArgs['post__not_in'] = $post__not_in;
|
144 |
+
}
|
145 |
+
|
146 |
+
/* LIMIT */
|
147 |
+
$args['posts_per_page'] = $itemIdsArgs['posts_per_page'] = $limit;
|
148 |
+
if (!$isIsotope && $pagination) {
|
149 |
+
if ($posts_per_page > $limit) {
|
150 |
+
$posts_per_page = $limit;
|
151 |
+
}
|
152 |
+
// Set 'posts_per_page' parameter
|
153 |
+
$args['posts_per_page'] = $posts_per_page;
|
154 |
+
if (get_query_var('paged')) {
|
155 |
+
$paged = get_query_var('paged');
|
156 |
+
} elseif (get_query_var('page')) {
|
157 |
+
$paged = get_query_var('page');
|
158 |
+
} else {
|
159 |
+
$paged = 1;
|
160 |
+
}
|
161 |
+
$offset = $posts_per_page * ((int)$paged - 1);
|
162 |
+
$args['paged'] = $paged;
|
163 |
+
|
164 |
+
// Update posts_per_page
|
165 |
+
if (intval($args['posts_per_page']) > $limit - $offset) {
|
166 |
+
$args['posts_per_page'] = $limit - $offset;
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
}
|
171 |
+
|
172 |
+
// Advance Filter
|
173 |
+
$adv_filter = isset($scMeta['post_filter']) ? $scMeta['post_filter'] : array();
|
174 |
+
|
175 |
+
// Taxonomy
|
176 |
+
$taxQ = array();
|
177 |
+
if (in_array('tpg_taxonomy', $adv_filter) && isset($scMeta['tpg_taxonomy'])) {
|
178 |
+
|
179 |
+
if (is_array($scMeta['tpg_taxonomy']) && !empty($scMeta['tpg_taxonomy'])) {
|
180 |
+
foreach ($scMeta['tpg_taxonomy'] as $taxonomy) {
|
181 |
+
$terms = (isset($scMeta['term_' . $taxonomy]) ? $scMeta['term_' . $taxonomy] : array());
|
182 |
+
if (is_array($terms) && !empty($terms)) {
|
183 |
+
$operator = isset($scMeta['term_operator_' . $taxonomy][0]) ? $scMeta['term_operator_' . $taxonomy][0] : "IN";
|
184 |
+
if ($preview) {
|
185 |
+
$operator = isset($scMeta['term_operator_' . $taxonomy]) ? $scMeta['term_operator_' . $taxonomy] : "IN";
|
186 |
+
}
|
187 |
+
$taxQ[] = array(
|
188 |
+
'taxonomy' => $taxonomy,
|
189 |
+
'field' => 'term_id',
|
190 |
+
'terms' => $terms,
|
191 |
+
'operator' => $operator,
|
192 |
+
);
|
193 |
+
}
|
194 |
+
}
|
195 |
+
}
|
196 |
+
if (count($taxQ) >= 2) {
|
197 |
+
$relation = isset($scMeta['taxonomy_relation'][0]) ? $scMeta['taxonomy_relation'][0] : "AND";
|
198 |
+
if ($preview) {
|
199 |
+
$relation = isset($scMeta['taxonomy_relation']) ? $scMeta['taxonomy_relation'] : "AND";
|
200 |
+
}
|
201 |
+
$taxQ['relation'] = $relation;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
|
205 |
+
if (!empty($taxQ)) {
|
206 |
+
$args['tax_query'] = $itemIdsArgs['tax_query'] = $taxQ;
|
207 |
+
}
|
208 |
+
|
209 |
+
// Order
|
210 |
+
if (in_array('order', $adv_filter)) {
|
211 |
+
if ($order) {
|
212 |
+
$args['order'] = $itemIdsArgs['order'] = $order;
|
213 |
+
}
|
214 |
+
if ($order_by) {
|
215 |
+
$args['orderby'] = $itemIdsArgs['orderby'] = $order_by;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
// Status
|
219 |
+
if (in_array('tpg_post_status', $adv_filter)) {
|
220 |
+
$post_status = (isset($scMeta['tpg_post_status']) ? $scMeta['tpg_post_status'] : array());
|
221 |
+
if (!empty($post_status)) {
|
222 |
+
$args['post_status'] = $itemIdsArgs['post_status'] = $post_status;
|
223 |
+
} else {
|
224 |
+
$args['post_status'] = $itemIdsArgs['post_status'] = 'publish';
|
225 |
+
}
|
226 |
+
}
|
227 |
+
// Author
|
228 |
+
$author = (isset($scMeta['author']) ? $scMeta['author'] : array());
|
229 |
+
if (in_array('author', $adv_filter) && !empty($author)) {
|
230 |
+
$args['author__in'] = $itemIdsArgs['author__in'] = $author;
|
231 |
+
}
|
232 |
+
// Search
|
233 |
+
if (in_array('s', $adv_filter) && $s) {
|
234 |
+
$args['s'] = $itemIdsArgs['s'] = $s;
|
235 |
+
}
|
236 |
+
|
237 |
+
// Validation
|
238 |
+
|
239 |
+
if (($layout == 'layout2') || ($layout == 'layout3')) {
|
240 |
+
$iCol = isset($scMeta['tgp_layout2_image_column'][0]) ? absint($scMeta['tgp_layout2_image_column'][0]) : 4;
|
241 |
+
if ($preview) {
|
242 |
+
$iCol = isset($scMeta['tgp_layout2_image_column']) ? absint($scMeta['tgp_layout2_image_column']) : 4;
|
243 |
+
}
|
244 |
+
$iCol = $iCol > 12 ? 4 : $iCol;
|
245 |
+
$cCol = 12 - $iCol;
|
246 |
+
$arg['image_area'] = "rt-col-sm-{$iCol} rt-col-xs-12 ";
|
247 |
+
$arg['content_area'] = "rt-col-sm-{$cCol} rt-col-xs-12 ";
|
248 |
+
}
|
249 |
+
$col = $col == 5 ? "24" : round(12 / $col);
|
250 |
+
if (($layout == 'layout2') || ($layout == 'layout3')) {
|
251 |
+
$arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-12 rt-col-xs-12";
|
252 |
+
} else {
|
253 |
+
$arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-6 rt-col-xs-12";
|
254 |
+
}
|
255 |
+
|
256 |
+
|
257 |
+
$arg['class'] = 'rt-equal-height';
|
258 |
+
if ($isIsotope) {
|
259 |
+
$arg['class'] .= ' isotope-item';
|
260 |
+
}
|
261 |
+
$arg['link'] = $link;
|
262 |
+
$arg['link_target'] = $link_target ? " target='{$link_target}'" : null;
|
263 |
+
|
264 |
+
$arg['overlay'] = empty($scMeta['tpg_overlay'][0]) ? false : true;
|
265 |
+
$parentClass = (!empty($scMeta['parent_class'][0]) ? trim($scMeta['parent_class'][0]) : null);
|
266 |
+
$arg['items'] = isset($scMeta['item_fields']) ? ($scMeta['item_fields'] ? $scMeta['item_fields'] : array()) : array();
|
267 |
+
$arg['title_tag'] = (!empty($scMeta['title_tag'][0]) && in_array($scMeta['title_tag'][0], array_keys(rtTPG()->getTitleTags()))) ? esc_attr($scMeta['title_tag'][0]) : 'h2';
|
268 |
+
$postQuery = new WP_Query(apply_filters('tpg_sc_query_args', $args, $scMeta));
|
269 |
+
// Start layout
|
270 |
+
$html .= "<div class='container-fluid rt-tpg-container rt-tpg-container-{$scMeta['sc_id']} {$parentClass}' data-sc-id='{$scMeta['sc_id']}' id='{$layoutID}'>";
|
271 |
+
$extClass = null;
|
272 |
+
if ($isIsotope) {
|
273 |
+
$extClass = ' tpg-isotope';
|
274 |
+
}
|
275 |
+
// Set readmore false if excerpt type = full content
|
276 |
+
if (isset($arg['excerpt_type']) && $arg['excerpt_type'] === 'full' && ($key = array_search('read_more', $arg['items'])) !== false) {
|
277 |
+
unset($arg['items'][$key]);
|
278 |
+
}
|
279 |
+
|
280 |
+
$html .= "<div class='rt-row rt-content-loader {$layout}{$extClass}'>";
|
281 |
+
if ($postQuery->have_posts()) {
|
282 |
+
$html .= $this->layoutStyle($layoutID, $scMeta, $preview);
|
283 |
+
|
284 |
+
if ($isIsotope) {
|
285 |
+
$selectedTerms = (isset($scMeta['term_' . $isotope_filter]) ? $scMeta['term_' . $isotope_filter] : array());
|
286 |
+
$terms = get_terms($isotope_filter, array(
|
287 |
+
'orderby' => 'name',
|
288 |
+
'order' => 'ASC',
|
289 |
+
'hide_empty' => false,
|
290 |
+
'include' => $selectedTerms
|
291 |
+
));
|
292 |
+
|
293 |
+
$html .= '<div id="iso-button-' . $rand . '" class="iso-button-' . $scMeta['sc_id'] . ' rt-tpg-isotope-buttons filter-button-group option-set">
|
294 |
<button data-filter="*" class="selected">' . $arg['show_all_text'] . '</button>';
|
295 |
+
if (!empty($terms) && !is_wp_error($terms)) {
|
296 |
+
foreach ($terms as $term) {
|
297 |
+
$html .= "<button data-filter='.iso_{$term->term_id}'>" . $term->name . "</button>";
|
298 |
+
}
|
299 |
+
}
|
300 |
+
$html .= '</div>';
|
301 |
+
|
302 |
+
$html .= '<div class="rt-tpg-isotope iso-tpg-' . $scMeta['sc_id'] . '" id="iso-tpg-' . $rand . '">';
|
303 |
+
}
|
304 |
+
|
305 |
+
|
306 |
+
while ($postQuery->have_posts()) {
|
307 |
+
$postQuery->the_post();
|
308 |
+
$pID = get_the_ID();
|
309 |
+
$arg['pID'] = $pID;
|
310 |
+
$arg['title'] = rtTPG()->get_the_title($pID, $arg);
|
311 |
+
$arg['pLink'] = get_permalink();
|
312 |
+
$arg['author'] = '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . get_the_author() . '</a>';
|
313 |
+
$cc = wp_count_comments($pID);
|
314 |
+
$arg['date'] = get_the_date();
|
315 |
+
$arg['excerpt'] = rtTPG()->get_the_excerpt($pID, $arg);
|
316 |
+
$arg['categories'] = get_the_term_list($pID, 'category', null, ', ');
|
317 |
+
$arg['tags'] = get_the_term_list($pID, 'post_tag', null, ', ');
|
318 |
+
if ($isIsotope) {
|
319 |
+
$termAs = wp_get_post_terms($pID, $isotope_filter, array("fields" => "all"));
|
320 |
+
$isoFilter = null;
|
321 |
+
if (!empty($termAs)) {
|
322 |
+
foreach ($termAs as $term) {
|
323 |
+
$isoFilter .= " iso_" . $term->term_id;
|
324 |
+
}
|
325 |
+
}
|
326 |
+
$arg['isoFilter'] = $isoFilter;
|
327 |
+
}
|
328 |
+
$deptClass = null;
|
329 |
+
if (!empty($deptAs)) {
|
330 |
+
foreach ($deptAs as $dept) {
|
331 |
+
$deptClass .= " " . $dept->slug;
|
332 |
+
}
|
333 |
+
}
|
334 |
+
if (comments_open()) {
|
335 |
+
$arg['comment'] = "<a href='" . get_comments_link($pID) . "'>{$cc->total_comments} </a>";
|
336 |
+
} else {
|
337 |
+
$arg['comment'] = "{$cc->total_comments}";
|
338 |
+
}
|
339 |
+
$imgSrc = null;
|
340 |
+
|
341 |
+
$arg['imgSrc'] = !$fImg ? rtTPG()->getFeatureImageSrc($pID, $fImgSize, $mediaSource) : null;
|
342 |
+
|
343 |
+
$html .= rtTPG()->render('layouts/' . $layout, $arg, true);
|
344 |
+
}
|
345 |
+
|
346 |
+
if ($isIsotope) {
|
347 |
+
$html .= '</div>'; // End isotope item holder
|
348 |
+
}
|
349 |
+
|
350 |
+
} else {
|
351 |
+
$html .= sprintf('<p>%s</p>',
|
352 |
+
apply_filters('tpg_not_found_text', __('No post found', 'the-post-grid'), $args, $scMeta)
|
353 |
+
);
|
354 |
+
}
|
355 |
+
$html .= "</div>"; // End row
|
356 |
+
if ($pagination && !$isIsotope) {
|
357 |
+
$found = 0;
|
358 |
+
if ($postQuery->found_posts > $limit) {
|
359 |
+
$found = $limit;
|
360 |
+
} else {
|
361 |
+
$found = $postQuery->found_posts;
|
362 |
+
}
|
363 |
+
$max_num_pages = ceil($found / $posts_per_page);
|
364 |
+
$html .= rtTPG()->rt_pagination($max_num_pages, $args['posts_per_page']);
|
365 |
+
}
|
366 |
+
$html .= "</div>"; // container rt-tpg
|
367 |
+
|
368 |
+
wp_reset_postdata();
|
369 |
+
if (!$preview) {
|
370 |
+
$scriptGenerator = array();
|
371 |
+
$scriptGenerator['layout'] = $layoutID;
|
372 |
+
$scriptGenerator['rand'] = $rand;
|
373 |
+
$scriptGenerator['scMeta'] = $scMeta;
|
374 |
+
$scriptGenerator['isIsotope'] = $isIsotope;
|
375 |
+
$this->scA[] = $scriptGenerator;
|
376 |
+
add_action('wp_footer', array($this, 'register_sc_scripts'));
|
377 |
+
}
|
378 |
+
} else {
|
379 |
+
if ($preview) {
|
380 |
+
$msg = __('Session Error !!', 'the-post-grid');
|
381 |
+
} else {
|
382 |
+
$html .= "<p>" . __("No shortCode found", 'the-post-grid') . "</p>";
|
383 |
+
}
|
384 |
+
}
|
385 |
+
if ($preview) {
|
386 |
+
wp_send_json(array(
|
387 |
+
'error' => $error,
|
388 |
+
'msg' => $msg,
|
389 |
+
'data' => $html
|
390 |
+
));
|
391 |
+
die();
|
392 |
+
}
|
393 |
+
|
394 |
+
return $html;
|
395 |
+
}
|
396 |
+
|
397 |
+
function layoutStyle($layout, $scMeta, $preview = false) {
|
398 |
+
if ($preview) {
|
399 |
+
$primaryColor = (!empty($scMeta['primary_color']) ? $scMeta['primary_color'] : null);
|
400 |
+
$button_bg_color = (!empty($scMeta['button_bg_color']) ? $scMeta['button_bg_color'] : null);
|
401 |
+
$button_hover_bg_color = (!empty($scMeta['button_hover_bg_color']) ? $scMeta['button_hover_bg_color'] : null);
|
402 |
+
$button_active_bg_color = (!empty($scMeta['button_active_bg_color']) ? $scMeta['button_active_bg_color'] : null);
|
403 |
+
$button_text_color = (!empty($scMeta['button_text_color']) ? $scMeta['button_text_color'] : null);
|
404 |
+
$title_color = isset($scMeta['title_color']) && !empty($scMeta['title_color']) ? $scMeta['title_color'] : null;
|
405 |
+
$title_hover_color = isset($scMeta['title_hover_color']) && !empty($scMeta['title_hover_color']) ? $scMeta['title_hover_color'] : null;
|
406 |
+
$read_more_button_border_radius = isset($scMeta['tpg_read_more_button_border_radius']) ? $scMeta['tpg_read_more_button_border_radius'] : '';
|
407 |
+
|
408 |
+
} else {
|
409 |
+
|
410 |
+
$primaryColor = (!empty($scMeta['primary_color'][0]) ? $scMeta['primary_color'][0] : null);
|
411 |
+
$button_bg_color = (!empty($scMeta['button_bg_color'][0]) ? $scMeta['button_bg_color'][0] : null);
|
412 |
+
$button_hover_bg_color = (!empty($scMeta['button_hover_bg_color'][0]) ? $scMeta['button_hover_bg_color'][0] : null);
|
413 |
+
$button_active_bg_color = (!empty($scMeta['button_active_bg_color'][0]) ? $scMeta['button_active_bg_color'][0] : null);
|
414 |
+
$button_text_color = (!empty($scMeta['button_text_color'][0]) ? $scMeta['button_text_color'][0] : null);
|
415 |
+
$title_color = isset($scMeta['title_color'][0]) && !empty($scMeta['title_color'][0]) ? $scMeta['title_color'][0] : null;
|
416 |
+
$title_hover_color = isset($scMeta['title_hover_color'][0]) && !empty($scMeta['title_hover_color'][0]) ? $scMeta['title_hover_color'][0] : null;
|
417 |
+
$read_more_button_border_radius = isset($scMeta['tpg_read_more_button_border_radius'][0]) ? $scMeta['tpg_read_more_button_border_radius'][0] : '';
|
418 |
+
|
419 |
+
}
|
420 |
+
$css = null;
|
421 |
+
$css .= "<style type='text/css' media='all'>";
|
422 |
+
// Variable
|
423 |
+
if ($primaryColor) {
|
424 |
+
$css .= "#{$layout} .rt-detail i,
|
425 |
#{$layout} .rt-detail .post-meta-user a,
|
426 |
#{$layout} .rt-detail .post-meta-category a{";
|
427 |
+
$css .= "color:" . $primaryColor . ";";
|
428 |
+
$css .= "}";
|
429 |
+
$css .= "body .rt-tpg-container .rt-tpg-isotope-buttons .selected{";
|
430 |
+
$css .= "background-color:" . $primaryColor . ";";
|
431 |
+
$css .= "}";
|
432 |
+
}
|
433 |
+
if ($button_bg_color) {
|
434 |
+
$css .= "#{$layout} .pagination li a,
|
435 |
#{$layout} .rt-tpg-isotope-buttons button,
|
436 |
#{$layout} .rt-detail .read-more a{";
|
437 |
+
$css .= "background-color:" . $button_bg_color . ";";
|
438 |
+
$css .= "}";
|
439 |
+
}
|
440 |
+
if ($button_hover_bg_color) {
|
441 |
+
$css .= "#{$layout} .pagination li a:hover,
|
442 |
#{$layout} .rt-tpg-isotope-buttons button:hover,
|
443 |
#{$layout} .rt-detail .read-more a:hover{";
|
444 |
+
$css .= "background-color:" . $button_hover_bg_color . ";";
|
445 |
+
$css .= "}";
|
446 |
+
}
|
447 |
+
if ($button_active_bg_color) {
|
448 |
+
$css .= "#{$layout} .pagination li.active span,
|
449 |
#{$layout} .rt-tpg-isotope-buttons button.selected{";
|
450 |
+
$css .= "background-color:" . $button_active_bg_color . ";";
|
451 |
+
$css .= "}";
|
452 |
+
}
|
453 |
+
if ($button_text_color) {
|
454 |
+
$css .= "#{$layout} .pagination li a,
|
455 |
#{$layout} .rt-tpg-isotope-buttons button,
|
456 |
#{$layout} .rt-detail .read-more a{";
|
457 |
+
$css .= "color:" . $button_text_color . ";";
|
458 |
+
$css .= "}";
|
459 |
+
}
|
460 |
+
if ($title_color) {
|
461 |
+
$css .= "#{$layout} .rt-detail h2.entry-title a,
|
462 |
#{$layout} .rt-detail h3.entry-title a,
|
463 |
#{$layout} .rt-detail h4.entry-title a{";
|
464 |
+
$css .= "color:" . $title_color . ";";
|
465 |
+
$css .= "}";
|
466 |
+
}
|
467 |
+
if ($title_hover_color) {
|
468 |
+
$css .= "#{$layout} .rt-detail h2.entry-title a:hover,
|
469 |
#{$layout} .rt-detail h3.entry-title a:hover,
|
470 |
#{$layout} .rt-detail h4.entry-title a:hover{";
|
471 |
+
$css .= "color:" . $title_hover_color . ";";
|
472 |
+
$css .= "}";
|
473 |
+
}
|
474 |
+
|
475 |
+
// Read more button Position
|
476 |
+
if (!empty($read_more_button_border_radius)) {
|
477 |
+
$css .= "#{$layout} .read-more a{";
|
478 |
+
$css .= "border-radius:" . $read_more_button_border_radius . "px;";
|
479 |
+
$css .= "}";
|
480 |
+
}
|
481 |
+
|
482 |
+
$css .= "</style>";
|
483 |
+
|
484 |
+
return $css;
|
485 |
+
}
|
486 |
+
}
|
487 |
endif;
|
lib/models/rtTPGField.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if(!class_exists('rtTPGField')):
|
4 |
class rtTPGField
|
5 |
{
|
6 |
private $type;
|
@@ -19,21 +19,20 @@ if(!class_exists('rtTPGField')):
|
|
19 |
private $alignment;
|
20 |
private $placeholder;
|
21 |
|
22 |
-
function __construct(){
|
23 |
}
|
24 |
|
25 |
-
private function setArgument($attr){
|
26 |
$this->type = isset($attr['type']) ? ($attr['type'] ? $attr['type'] : 'text') : 'text';
|
27 |
$this->multiple = isset($attr['multiple']) ? ($attr['multiple'] ? $attr['multiple'] : false) : false;
|
28 |
$this->name = isset($attr['name']) ? ($attr['name'] ? $attr['name'] : null) : null;
|
29 |
-
$this->name = isset($attr['name']) ? ($attr['name'] ? $attr['name'] : null) : null;
|
30 |
$this->default = isset($attr['default']) ? ($attr['default'] ? $attr['default'] : null) : null;
|
31 |
$this->value = isset($attr['value']) ? ($attr['value'] ? $attr['value'] : null) : null;
|
32 |
|
33 |
-
if(!$this->value){
|
34 |
-
if($this->multiple){
|
35 |
$v = get_post_meta(get_the_ID(), $this->name);
|
36 |
-
}else{
|
37 |
$v = get_post_meta(get_the_ID(), $this->name, true);
|
38 |
}
|
39 |
$this->value = ($v ? $v : $this->default);
|
@@ -49,64 +48,61 @@ if(!class_exists('rtTPGField')):
|
|
49 |
$this->option = isset($attr['option']) ? ($attr['option'] ? $attr['option'] : null) : null;
|
50 |
$this->attr = isset($attr['attr']) ? ($attr['attr'] ? $attr['attr'] : null) : null;
|
51 |
$this->alignment = isset($attr['alignment']) ? ($attr['alignment'] ? $attr['alignment'] : null) : null;
|
52 |
-
|
53 |
}
|
54 |
|
55 |
-
public function Field($attr)
|
56 |
-
{
|
57 |
$this->setArgument($attr);
|
|
|
58 |
$html = null;
|
59 |
-
$html .= "<div class='field-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
$html .="</div>"; // field
|
103 |
-
$html .="</div>"; // field holder
|
104 |
|
105 |
return $html;
|
106 |
}
|
107 |
|
108 |
-
private function text()
|
109 |
-
{
|
110 |
$h = null;
|
111 |
$h .= "<input
|
112 |
type='text'
|
@@ -120,15 +116,15 @@ if(!class_exists('rtTPGField')):
|
|
120 |
return $h;
|
121 |
}
|
122 |
|
123 |
-
private
|
124 |
$h = null;
|
125 |
$h .= '<div class="rt-custom-css">';
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
|
131 |
-
|
132 |
style='display: none;'
|
133 |
class='custom_css_textarea'
|
134 |
id='{$this->id}'
|
@@ -139,8 +135,7 @@ if(!class_exists('rtTPGField')):
|
|
139 |
return $h;
|
140 |
}
|
141 |
|
142 |
-
private function url()
|
143 |
-
{
|
144 |
$h = null;
|
145 |
$h .= "<input
|
146 |
type='url'
|
@@ -154,8 +149,7 @@ if(!class_exists('rtTPGField')):
|
|
154 |
return $h;
|
155 |
}
|
156 |
|
157 |
-
private function number()
|
158 |
-
{
|
159 |
$h = null;
|
160 |
$h .= "<input
|
161 |
type='number'
|
@@ -169,31 +163,29 @@ if(!class_exists('rtTPGField')):
|
|
169 |
return $h;
|
170 |
}
|
171 |
|
172 |
-
private function select()
|
173 |
-
{
|
174 |
$h = null;
|
175 |
-
if($this->multiple){
|
176 |
$this->attr = " style='min-width:160px;'";
|
177 |
-
$this->name = $this->name."[]";
|
178 |
-
$this->attr = $this->attr." multiple='multiple'";
|
179 |
$this->value = (is_array($this->value) && !empty($this->value) ? $this->value : array());
|
180 |
-
}else{
|
181 |
$this->value = array($this->value);
|
182 |
}
|
183 |
|
184 |
$h .= "<select name='{$this->name}' id='{$this->id}' class='{$this->class}' {$this->attr}>";
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
}
|
190 |
}
|
|
|
191 |
$h .= "</select>";
|
192 |
return $h;
|
193 |
}
|
194 |
|
195 |
-
private function textArea()
|
196 |
-
{
|
197 |
$h = null;
|
198 |
$h .= "<textarea
|
199 |
class='{$this->class} rt-textarea'
|
@@ -205,14 +197,13 @@ if(!class_exists('rtTPGField')):
|
|
205 |
return $h;
|
206 |
}
|
207 |
|
208 |
-
private function checkbox()
|
209 |
-
{
|
210 |
$h = null;
|
211 |
-
if($this->multiple){
|
212 |
-
$this->name = $this->name."[]";
|
213 |
$this->value = (is_array($this->value) && !empty($this->value) ? $this->value : array());
|
214 |
}
|
215 |
-
if($this->multiple) {
|
216 |
$h .= "<div class='checkbox-group {$this->alignment}' id='{$this->id}'>";
|
217 |
if (is_array($this->options) && !empty($this->options)) {
|
218 |
foreach ($this->options as $key => $value) {
|
@@ -223,15 +214,14 @@ if(!class_exists('rtTPGField')):
|
|
223 |
}
|
224 |
}
|
225 |
$h .= "</div>";
|
226 |
-
}else{
|
227 |
$checked = ($this->value ? "checked" : null);
|
228 |
$h .= "<label><input type='checkbox' {$checked} id='{$this->id}' name='{$this->name}' value='1' />{$this->option}</label>";
|
229 |
}
|
230 |
return $h;
|
231 |
}
|
232 |
|
233 |
-
private function radioField()
|
234 |
-
{
|
235 |
$h = null;
|
236 |
$h .= "<div class='radio-group {$this->alignment}' id='{$this->id}'>";
|
237 |
if (is_array($this->options) && !empty($this->options)) {
|
1 |
<?php
|
2 |
|
3 |
+
if (!class_exists('rtTPGField')):
|
4 |
class rtTPGField
|
5 |
{
|
6 |
private $type;
|
19 |
private $alignment;
|
20 |
private $placeholder;
|
21 |
|
22 |
+
function __construct() {
|
23 |
}
|
24 |
|
25 |
+
private function setArgument($attr) {
|
26 |
$this->type = isset($attr['type']) ? ($attr['type'] ? $attr['type'] : 'text') : 'text';
|
27 |
$this->multiple = isset($attr['multiple']) ? ($attr['multiple'] ? $attr['multiple'] : false) : false;
|
28 |
$this->name = isset($attr['name']) ? ($attr['name'] ? $attr['name'] : null) : null;
|
|
|
29 |
$this->default = isset($attr['default']) ? ($attr['default'] ? $attr['default'] : null) : null;
|
30 |
$this->value = isset($attr['value']) ? ($attr['value'] ? $attr['value'] : null) : null;
|
31 |
|
32 |
+
if (!$this->value) {
|
33 |
+
if ($this->multiple) {
|
34 |
$v = get_post_meta(get_the_ID(), $this->name);
|
35 |
+
} else {
|
36 |
$v = get_post_meta(get_the_ID(), $this->name, true);
|
37 |
}
|
38 |
$this->value = ($v ? $v : $this->default);
|
48 |
$this->option = isset($attr['option']) ? ($attr['option'] ? $attr['option'] : null) : null;
|
49 |
$this->attr = isset($attr['attr']) ? ($attr['attr'] ? $attr['attr'] : null) : null;
|
50 |
$this->alignment = isset($attr['alignment']) ? ($attr['alignment'] ? $attr['alignment'] : null) : null;
|
51 |
+
$this->class = $this->class ? $this->class . " rt-form-control" : "rt-form-control";
|
52 |
}
|
53 |
|
54 |
+
public function Field($attr) {
|
|
|
55 |
$this->setArgument($attr);
|
56 |
+
$holderId = $this->name . "_holder";
|
57 |
$html = null;
|
58 |
+
$html .= "<div class='rt-field-wrapper {$this->holderClass}' id='{$holderId}'>";
|
59 |
+
$html .= sprintf('<div class="rt-label">%s</div>',
|
60 |
+
$this->label ? sprintf('<label for="">%s</label>', $this->label) : ''
|
61 |
+
);
|
62 |
+
$html .= "<div class='rt-field'>";
|
63 |
+
switch ($this->type) {
|
64 |
+
case 'text':
|
65 |
+
$html .= $this->text();
|
66 |
+
break;
|
67 |
+
|
68 |
+
case 'url':
|
69 |
+
$html .= $this->url();
|
70 |
+
break;
|
71 |
+
|
72 |
+
case 'number':
|
73 |
+
$html .= $this->number();
|
74 |
+
break;
|
75 |
+
|
76 |
+
case 'select':
|
77 |
+
$html .= $this->select();
|
78 |
+
break;
|
79 |
+
|
80 |
+
case 'textarea':
|
81 |
+
$html .= $this->textArea();
|
82 |
+
break;
|
83 |
+
|
84 |
+
case 'checkbox':
|
85 |
+
$html .= $this->checkbox();
|
86 |
+
break;
|
87 |
+
|
88 |
+
case 'radio':
|
89 |
+
$html .= $this->radioField();
|
90 |
+
break;
|
91 |
+
|
92 |
+
case 'custom_css':
|
93 |
+
$html .= $this->customCss();
|
94 |
+
break;
|
95 |
+
}
|
96 |
+
if ($this->description) {
|
97 |
+
$html .= "<p class='description'>{$this->description}</p>";
|
98 |
+
}
|
99 |
+
$html .= "</div>"; // field
|
100 |
+
$html .= "</div>"; // field holder
|
|
|
|
|
101 |
|
102 |
return $html;
|
103 |
}
|
104 |
|
105 |
+
private function text() {
|
|
|
106 |
$h = null;
|
107 |
$h .= "<input
|
108 |
type='text'
|
116 |
return $h;
|
117 |
}
|
118 |
|
119 |
+
private function customCss() {
|
120 |
$h = null;
|
121 |
$h .= '<div class="rt-custom-css">';
|
122 |
+
$h .= '<div class="custom_css_container">';
|
123 |
+
$h .= "<div name='{$this->name}' id='ret-" . mt_rand() . "' class='custom-css'>";
|
124 |
+
$h .= '</div>';
|
125 |
+
$h .= '</div>';
|
126 |
|
127 |
+
$h .= "<textarea
|
128 |
style='display: none;'
|
129 |
class='custom_css_textarea'
|
130 |
id='{$this->id}'
|
135 |
return $h;
|
136 |
}
|
137 |
|
138 |
+
private function url() {
|
|
|
139 |
$h = null;
|
140 |
$h .= "<input
|
141 |
type='url'
|
149 |
return $h;
|
150 |
}
|
151 |
|
152 |
+
private function number() {
|
|
|
153 |
$h = null;
|
154 |
$h .= "<input
|
155 |
type='number'
|
163 |
return $h;
|
164 |
}
|
165 |
|
166 |
+
private function select() {
|
|
|
167 |
$h = null;
|
168 |
+
if ($this->multiple) {
|
169 |
$this->attr = " style='min-width:160px;'";
|
170 |
+
$this->name = $this->name . "[]";
|
171 |
+
$this->attr = $this->attr . " multiple='multiple'";
|
172 |
$this->value = (is_array($this->value) && !empty($this->value) ? $this->value : array());
|
173 |
+
} else {
|
174 |
$this->value = array($this->value);
|
175 |
}
|
176 |
|
177 |
$h .= "<select name='{$this->name}' id='{$this->id}' class='{$this->class}' {$this->attr}>";
|
178 |
+
if (is_array($this->options) && !empty($this->options)) {
|
179 |
+
foreach ($this->options as $key => $value) {
|
180 |
+
$slt = (in_array($key, $this->value) ? "selected" : null);
|
181 |
+
$h .= "<option {$slt} value='{$key}'>{$value}</option>";
|
|
|
182 |
}
|
183 |
+
}
|
184 |
$h .= "</select>";
|
185 |
return $h;
|
186 |
}
|
187 |
|
188 |
+
private function textArea() {
|
|
|
189 |
$h = null;
|
190 |
$h .= "<textarea
|
191 |
class='{$this->class} rt-textarea'
|
197 |
return $h;
|
198 |
}
|
199 |
|
200 |
+
private function checkbox() {
|
|
|
201 |
$h = null;
|
202 |
+
if ($this->multiple) {
|
203 |
+
$this->name = $this->name . "[]";
|
204 |
$this->value = (is_array($this->value) && !empty($this->value) ? $this->value : array());
|
205 |
}
|
206 |
+
if ($this->multiple) {
|
207 |
$h .= "<div class='checkbox-group {$this->alignment}' id='{$this->id}'>";
|
208 |
if (is_array($this->options) && !empty($this->options)) {
|
209 |
foreach ($this->options as $key => $value) {
|
214 |
}
|
215 |
}
|
216 |
$h .= "</div>";
|
217 |
+
} else {
|
218 |
$checked = ($this->value ? "checked" : null);
|
219 |
$h .= "<label><input type='checkbox' {$checked} id='{$this->id}' name='{$this->name}' value='1' />{$this->option}</label>";
|
220 |
}
|
221 |
return $h;
|
222 |
}
|
223 |
|
224 |
+
private function radioField() {
|
|
|
225 |
$h = null;
|
226 |
$h .= "<div class='radio-group {$this->alignment}' id='{$this->id}'>";
|
227 |
if (is_array($this->options) && !empty($this->options)) {
|
lib/views/layouts/isotope1.php
CHANGED
@@ -1,24 +1,46 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
$html = null;
|
4 |
|
5 |
$html .= "<div class='{$grid} {$class} {$isoFilter}'>";
|
6 |
$html .= '<div class="rt-holder">';
|
7 |
if(!empty($imgSrc)) {
|
8 |
$html .= '<div class="rt-img-holder">';
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
17 |
$html .= '</div> ';
|
18 |
}
|
19 |
$html .= '<div class="rt-detail">';
|
20 |
if(in_array('title', $items)){
|
21 |
-
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
$postMetaTop = $postMetaMid = null;
|
24 |
|
@@ -48,8 +70,8 @@ $html .= "<div class='{$grid} {$class} {$isoFilter}'>";
|
|
48 |
if(in_array('excerpt', $items) && $excerpt){
|
49 |
$html .= "<div class='entry-content'><p>{$excerpt}</p></div>";
|
50 |
}
|
51 |
-
if(in_array('read_more', $items)){
|
52 |
-
|
53 |
}
|
54 |
$html .= '</div>';
|
55 |
$html .= '</div>';
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* @var string $grid
|
4 |
+
* @var string $pLink
|
5 |
+
* @var string $class
|
6 |
+
* @var bool $link
|
7 |
+
* @var string $link_target
|
8 |
+
* @var string $title_tag
|
9 |
+
* @var string $categories
|
10 |
+
* @var string $read_more_text
|
11 |
+
* @var string $date
|
12 |
+
* @var string $author
|
13 |
+
* @var string $isoFilter
|
14 |
+
* @var bool $overlay
|
15 |
+
* @var array $items
|
16 |
+
*/
|
17 |
$html = null;
|
18 |
|
19 |
$html .= "<div class='{$grid} {$class} {$isoFilter}'>";
|
20 |
$html .= '<div class="rt-holder">';
|
21 |
if(!empty($imgSrc)) {
|
22 |
$html .= '<div class="rt-img-holder">';
|
23 |
+
if($overlay && $link) {
|
24 |
+
$html .= sprintf('<div class="overlay">
|
25 |
+
<div class="link-holder">
|
26 |
+
<a class="view-details" href="%s"%s><i class="fa fa-info"></i></a>
|
27 |
+
</div>
|
28 |
+
</div>', $pLink, $link_target);
|
29 |
+
}
|
30 |
+
if($link) {
|
31 |
+
$html .= sprintf('<a href="%s"%s><img class="img-responsive" src="%s" alt="%s"></a>', $pLink,$link_target, $imgSrc, $title);
|
32 |
+
}else{
|
33 |
+
$html .= "<img class='img-responsive' src='{$imgSrc}' alt='{$title}'>";
|
34 |
+
}
|
35 |
$html .= '</div> ';
|
36 |
}
|
37 |
$html .= '<div class="rt-detail">';
|
38 |
if(in_array('title', $items)){
|
39 |
+
if($link) {
|
40 |
+
$html .= sprintf('<%1$s class="entry-title"><a href="%2$s"%4$s>%3$s</a></%1$s>', $title_tag, $pLink, $title,$link_target);
|
41 |
+
}else{
|
42 |
+
$html .= sprintf('<%1$s class="entry-title">%2$s</%1$s>', $title_tag, $title);
|
43 |
+
}
|
44 |
}
|
45 |
$postMetaTop = $postMetaMid = null;
|
46 |
|
70 |
if(in_array('excerpt', $items) && $excerpt){
|
71 |
$html .= "<div class='entry-content'><p>{$excerpt}</p></div>";
|
72 |
}
|
73 |
+
if(in_array('read_more', $items) && $link){
|
74 |
+
$html .= sprintf('<div class="read-more"><a href="%s"%s>%s</a></div>', $pLink, $link_target, $read_more_text);
|
75 |
}
|
76 |
$html .= '</div>';
|
77 |
$html .= '</div>';
|
lib/views/layouts/layout1.php
CHANGED
@@ -1,19 +1,40 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
$html = null;
|
4 |
$html .= "<div class='{$grid} {$class}'>";
|
5 |
$html .= '<div class="rt-holder">';
|
6 |
if(!empty($imgSrc)) {
|
7 |
$html .= '<div class="rt-img-holder">';
|
8 |
-
if($overlay) {
|
9 |
-
$html .= sprintf('<div class="overlay"><a class="view-details" href="%s"><i class="fa fa-info"></i></a></div>', $pLink);
|
10 |
}
|
11 |
-
$
|
|
|
|
|
|
|
|
|
12 |
$html .= '</div> ';
|
13 |
}
|
14 |
$html .= '<div class="rt-detail">';
|
15 |
if(in_array('title', $items)){
|
16 |
-
|
|
|
|
|
|
|
|
|
17 |
}
|
18 |
$postMetaTop = $postMetaMid =null;
|
19 |
|
@@ -44,10 +65,8 @@ $html .= "<div class='{$grid} {$class}'>";
|
|
44 |
$html .= "<div class='post-content'>{$excerpt}</div>";
|
45 |
}
|
46 |
$postMetaBottom = null;
|
47 |
-
|
48 |
-
|
49 |
-
if(in_array('read_more', $items)){
|
50 |
-
$postMetaBottom .= "<span class='read-more'><a href='{$pLink}'>{$read_more_text}</a></span>";
|
51 |
}
|
52 |
if(!empty($postMetaBottom)){
|
53 |
$html .= "<div class='post-meta'>$postMetaBottom</div>";
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* @var string $grid
|
4 |
+
* @var string $pLink
|
5 |
+
* @var string $class
|
6 |
+
* @var bool $link
|
7 |
+
* @var string $link_target
|
8 |
+
* @var string $title_tag
|
9 |
+
* @var string $categories
|
10 |
+
* @var string $read_more_text
|
11 |
+
* @var string $date
|
12 |
+
* @var string $author
|
13 |
+
* @var bool $overlay
|
14 |
+
* @var array $items
|
15 |
+
*/
|
16 |
$html = null;
|
17 |
$html .= "<div class='{$grid} {$class}'>";
|
18 |
$html .= '<div class="rt-holder">';
|
19 |
if(!empty($imgSrc)) {
|
20 |
$html .= '<div class="rt-img-holder">';
|
21 |
+
if($overlay && $link) {
|
22 |
+
$html .= sprintf('<div class="overlay"><a class="view-details" href="%s"%s><i class="fa fa-info"></i></a></div>', $pLink, $link_target);
|
23 |
}
|
24 |
+
if($link) {
|
25 |
+
$html .= sprintf('<a href="%s"%s><img class="img-responsive" src="%s" alt="%s"></a>', $pLink,$link_target, $imgSrc, $title);
|
26 |
+
}else{
|
27 |
+
$html .= "<img class='img-responsive' src='{$imgSrc}' alt='{$title}'>";
|
28 |
+
}
|
29 |
$html .= '</div> ';
|
30 |
}
|
31 |
$html .= '<div class="rt-detail">';
|
32 |
if(in_array('title', $items)){
|
33 |
+
if($link) {
|
34 |
+
$html .= sprintf('<%1$s class="entry-title"><a href="%2$s"%4$s>%3$s</a></%1$s>', $title_tag, $pLink, $title,$link_target);
|
35 |
+
}else{
|
36 |
+
$html .= sprintf('<%1$s class="entry-title">%2$s</%1$s>', $title_tag, $title);
|
37 |
+
}
|
38 |
}
|
39 |
$postMetaTop = $postMetaMid =null;
|
40 |
|
65 |
$html .= "<div class='post-content'>{$excerpt}</div>";
|
66 |
}
|
67 |
$postMetaBottom = null;
|
68 |
+
if(in_array('read_more', $items) && $link){
|
69 |
+
$postMetaBottom .= sprintf('<div class="read-more"><a href="%s"%s>%s</a></div>', $pLink, $link_target, $read_more_text);
|
|
|
|
|
70 |
}
|
71 |
if(!empty($postMetaBottom)){
|
72 |
$html .= "<div class='post-meta'>$postMetaBottom</div>";
|
lib/views/layouts/layout2.php
CHANGED
@@ -1,4 +1,19 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
$html = null;
|
3 |
$html .= "<div class='{$grid} {$class}'>";
|
4 |
$html .= '<div class="rt-holder">';
|
@@ -6,14 +21,18 @@ $html .= "<div class='{$grid} {$class}'>";
|
|
6 |
if(!empty($imgSrc)) {
|
7 |
$html .= "<div class='{$image_area}'>";
|
8 |
$html .= '<div class="rt-img-holder">';
|
9 |
-
if($overlay) {
|
10 |
-
$html .= '<div class="overlay">
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
}
|
16 |
-
|
|
|
|
|
|
|
|
|
17 |
$html .= '</div>';
|
18 |
$html .= '</div>';
|
19 |
}else{
|
@@ -22,7 +41,11 @@ $html .= "<div class='{$grid} {$class}'>";
|
|
22 |
$html .= "<div class='{$content_area}'>";
|
23 |
$html .= '<div class="rt-detail">';
|
24 |
if(in_array('title', $items)){
|
25 |
-
|
|
|
|
|
|
|
|
|
26 |
}
|
27 |
|
28 |
$metaHtml = null;
|
@@ -46,10 +69,10 @@ $html .= "<div class='{$grid} {$class}'>";
|
|
46 |
}
|
47 |
|
48 |
if(in_array('excerpt', $items)){
|
49 |
-
$html .= "<
|
50 |
}
|
51 |
-
if(in_array('read_more', $items)){
|
52 |
-
$html .=
|
53 |
}
|
54 |
$html .= '</div>';
|
55 |
$html .= '</div>';
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* @var string $grid
|
4 |
+
* @var string $pLink
|
5 |
+
* @var string $class
|
6 |
+
* @var bool $link
|
7 |
+
* @var string $link_target
|
8 |
+
* @var string $title_tag
|
9 |
+
* @var string $image_area
|
10 |
+
* @var string $categories
|
11 |
+
* @var string $read_more_text
|
12 |
+
* @var string $date
|
13 |
+
* @var string $author
|
14 |
+
* @var bool $overlay
|
15 |
+
* @var array $items
|
16 |
+
*/
|
17 |
$html = null;
|
18 |
$html .= "<div class='{$grid} {$class}'>";
|
19 |
$html .= '<div class="rt-holder">';
|
21 |
if(!empty($imgSrc)) {
|
22 |
$html .= "<div class='{$image_area}'>";
|
23 |
$html .= '<div class="rt-img-holder">';
|
24 |
+
if($overlay && $link) {
|
25 |
+
$html .= sprintf('<div class="overlay">
|
26 |
+
<div class="link-holder">
|
27 |
+
<a class="view-details" href="%s"%s><i class="fa fa-info"></i></a>
|
28 |
+
</div>
|
29 |
+
</div>', $pLink, $link_target);
|
30 |
}
|
31 |
+
if($link) {
|
32 |
+
$html .= sprintf('<a href="%s"%s><img class="img-responsive" src="%s" alt="%s"></a>', $pLink,$link_target, $imgSrc, $title);
|
33 |
+
}else{
|
34 |
+
$html .= "<img class='img-responsive' src='{$imgSrc}' alt='{$title}'>";
|
35 |
+
}
|
36 |
$html .= '</div>';
|
37 |
$html .= '</div>';
|
38 |
}else{
|
41 |
$html .= "<div class='{$content_area}'>";
|
42 |
$html .= '<div class="rt-detail">';
|
43 |
if(in_array('title', $items)){
|
44 |
+
if($link) {
|
45 |
+
$html .= sprintf('<%1$s class="entry-title"><a href="%2$s"%4$s>%3$s</a></%1$s>', $title_tag, $pLink, $title,$link_target);
|
46 |
+
}else{
|
47 |
+
$html .= sprintf('<%1$s class="entry-title">%2$s</%1$s>', $title_tag, $title);
|
48 |
+
}
|
49 |
}
|
50 |
|
51 |
$metaHtml = null;
|
69 |
}
|
70 |
|
71 |
if(in_array('excerpt', $items)){
|
72 |
+
$html .= "<div class='post-content'>{$excerpt}</div>";
|
73 |
}
|
74 |
+
if(in_array('read_more', $items) && $link){
|
75 |
+
$html .= sprintf('<div class="read-more"><a href="%s"%s>%s</a></div>', $pLink, $link_target, $read_more_text);
|
76 |
}
|
77 |
$html .= '</div>';
|
78 |
$html .= '</div>';
|
lib/views/layouts/layout3.php
CHANGED
@@ -1,5 +1,19 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
$html = null;
|
4 |
|
5 |
$html .= "<div class='{$grid} {$class}'>";
|
@@ -8,14 +22,18 @@ $html .= "<div class='{$grid} {$class}'>";
|
|
8 |
if(!empty($imgSrc)) {
|
9 |
$html .= "<div class='{$image_area}'>";
|
10 |
$html .= '<div class="rt-img-holder">';
|
11 |
-
if($overlay) {
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
}
|
18 |
-
|
|
|
|
|
|
|
|
|
19 |
$html .= '</div>';
|
20 |
$html .= '</div>';
|
21 |
}else{
|
@@ -24,7 +42,11 @@ $html .= "<div class='{$grid} {$class}'>";
|
|
24 |
$html .= "<div class='{$content_area}'>";
|
25 |
$html .= '<div class="rt-detail">';
|
26 |
if(in_array('title', $items)){
|
27 |
-
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
$metaHtml = null;
|
30 |
if(in_array('post_date', $items) && $date){
|
@@ -49,8 +71,8 @@ $html .= "<div class='{$grid} {$class}'>";
|
|
49 |
if(in_array('excerpt', $items)){
|
50 |
$html .= "<div class='post-content'>{$excerpt}</div>";
|
51 |
}
|
52 |
-
if(in_array('read_more', $items)){
|
53 |
-
$html .=
|
54 |
}
|
55 |
$html .= '</div>';
|
56 |
$html .= '</div>';
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* @var string $grid
|
4 |
+
* @var string $pLink
|
5 |
+
* @var string $class
|
6 |
+
* @var bool $link
|
7 |
+
* @var string $link_target
|
8 |
+
* @var string $title_tag
|
9 |
+
* @var string $image_area
|
10 |
+
* @var string $categories
|
11 |
+
* @var string $read_more_text
|
12 |
+
* @var string $date
|
13 |
+
* @var string $author
|
14 |
+
* @var bool $overlay
|
15 |
+
* @var array $items
|
16 |
+
*/
|
17 |
$html = null;
|
18 |
|
19 |
$html .= "<div class='{$grid} {$class}'>";
|
22 |
if(!empty($imgSrc)) {
|
23 |
$html .= "<div class='{$image_area}'>";
|
24 |
$html .= '<div class="rt-img-holder">';
|
25 |
+
if($overlay && $link) {
|
26 |
+
$html .= sprintf('<div class="overlay">
|
27 |
+
<div class="link-holder">
|
28 |
+
<a class="view-details" href="%s"%s><i class="fa fa-info"></i></a>
|
29 |
+
</div>
|
30 |
+
</div>', $pLink, $link_target);
|
31 |
}
|
32 |
+
if($link) {
|
33 |
+
$html .= sprintf('<a href="%s"%s><img class="img-responsive rounded" src="%s" alt="%s"></a>', $pLink,$link_target, $imgSrc, $title);
|
34 |
+
}else{
|
35 |
+
$html .= "<img class='img-responsive rounded' src='{$imgSrc}' alt='{$title}'>";
|
36 |
+
}
|
37 |
$html .= '</div>';
|
38 |
$html .= '</div>';
|
39 |
}else{
|
42 |
$html .= "<div class='{$content_area}'>";
|
43 |
$html .= '<div class="rt-detail">';
|
44 |
if(in_array('title', $items)){
|
45 |
+
if($link) {
|
46 |
+
$html .= sprintf('<%1$s class="entry-title"><a href="%2$s"%4$s>%3$s</a></%1$s>', $title_tag, $pLink, $title,$link_target);
|
47 |
+
}else{
|
48 |
+
$html .= sprintf('<%1$s class="entry-title">%2$s</%1$s>', $title_tag, $title);
|
49 |
+
}
|
50 |
}
|
51 |
$metaHtml = null;
|
52 |
if(in_array('post_date', $items) && $date){
|
71 |
if(in_array('excerpt', $items)){
|
72 |
$html .= "<div class='post-content'>{$excerpt}</div>";
|
73 |
}
|
74 |
+
if(in_array('read_more', $items) && $link){
|
75 |
+
$html .= sprintf('<div class="read-more"><a href="%s"%s>%s</a></div>', $pLink, $link_target, $read_more_text);
|
76 |
}
|
77 |
$html .= '</div>';
|
78 |
$html .= '</div>';
|
lib/views/settings/post-source.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
global $rtTPG;
|
3 |
echo $rtTPG->rtFieldGenerator($rtTPG->rtTPGPostType());
|
4 |
$sHtml = null;
|
5 |
-
$sHtml .= '<div class="field-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
$sHtml .= '</div>';
|
11 |
|
12 |
echo $sHtml;
|
@@ -16,191 +16,191 @@ echo $sHtml;
|
|
16 |
<div class='rt-tpg-filter-container'>
|
17 |
<?php echo $rtTPG->rtFieldGenerator($rtTPG->rtTPAdvanceFilters()); ?>
|
18 |
<div class="rt-tpg-filter-holder">
|
19 |
-
<h3
|
20 |
<?php
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
}
|
46 |
-
$html .= "</div>";
|
47 |
-
$html .= "<div class='rt-tpg-filter-item term-filter-item hidden'>";
|
48 |
-
$html .= '<div class="field-holder">';
|
49 |
-
$html .= '<div class="field-label">Terms</div>';
|
50 |
-
$html .= '<div class="field term-filter-holder">';
|
51 |
-
if(is_array($taxA) && !empty($taxA)){
|
52 |
-
foreach($taxA as $tax){
|
53 |
-
|
54 |
-
$html .="<div class='term-filter-item-container {$tax}'>";
|
55 |
-
$html .= $rtTPG->rtFieldGenerator(
|
56 |
-
array(
|
57 |
-
'type' => 'select',
|
58 |
-
'name' => 'term_'.$tax,
|
59 |
-
'label' => ucfirst(str_replace('_', ' ', $tax)),
|
60 |
-
'class' => 'rt-select2 full',
|
61 |
-
'holderClass' => "term-filter-item {$tax}",
|
62 |
-
'value' => get_post_meta($post->ID, 'term_'.$tax),
|
63 |
-
"multiple" => true,
|
64 |
-
'options' => $rtTPG->rt_get_all_term_by_taxonomy($tax)
|
65 |
-
)
|
66 |
-
);
|
67 |
-
$html .= $rtTPG->rtFieldGenerator(
|
68 |
-
array(
|
69 |
-
'type' => 'select',
|
70 |
-
'name' => 'term_operator_'.$tax,
|
71 |
-
'label' => 'Operator',
|
72 |
-
'class' => 'rt-select2 full',
|
73 |
-
'holderClass' => "term-filter-item-operator {$tax}",
|
74 |
-
'value' => get_post_meta($post->ID, 'term_operator_'.$tax, true),
|
75 |
-
'options' => $rtTPG->rtTermOperators()
|
76 |
-
)
|
77 |
-
);
|
78 |
-
$html .= "</div>";
|
79 |
-
}
|
80 |
-
}
|
81 |
-
$html .= "</div>";
|
82 |
-
$html .= "</div>";
|
83 |
-
|
84 |
-
$html .= $rtTPG->rtFieldGenerator(
|
85 |
-
array(
|
86 |
-
'type' => 'select',
|
87 |
-
'name' => 'taxonomy_relation',
|
88 |
-
'label' => 'Relation',
|
89 |
-
'class' => 'rt-select2',
|
90 |
-
'holderClass' => "term-filter-item-relation ". (count($taxA) > 1 ? null : "hidden"),
|
91 |
-
'value' => get_post_meta($post->ID, 'taxonomy_relation', true),
|
92 |
-
'options' => $rtTPG->rtTermRelations()
|
93 |
-
)
|
94 |
-
);
|
95 |
-
|
96 |
-
$html .= "</div>";
|
97 |
-
}else{
|
98 |
-
|
99 |
-
$html .= "<div class='taxonomy-field'>";
|
100 |
-
$html .= "</div>";
|
101 |
-
$html .= "<div class='rt-tpg-filter-item'>";
|
102 |
-
$html .= '<div class="field-holder">';
|
103 |
-
$html .= '<div class="field-label">Terms</div>';
|
104 |
-
$html .= '<div class="field term-filter-holder">';
|
105 |
-
$html .= "</div>";
|
106 |
-
$html .= "</div>";
|
107 |
-
$html .= "</div>";
|
108 |
-
$html .= $rtTPG->rtFieldGenerator(
|
109 |
-
array(
|
110 |
-
'type' => 'select',
|
111 |
-
'name' => 'taxonomy_relation',
|
112 |
-
'label' => 'Relation',
|
113 |
-
'class' => 'rt-select2',
|
114 |
-
'holderClass' => "term-filter-item-relation hidden",
|
115 |
-
'default' => 'OR',
|
116 |
-
'options' => $rtTPG->rtTermRelations()
|
117 |
-
)
|
118 |
-
);
|
119 |
}
|
120 |
$html .= "</div>";
|
121 |
-
|
122 |
-
$html .=
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
'type' => 'select',
|
130 |
-
'name' => 'order_by',
|
131 |
-
'label' => 'Order by',
|
132 |
-
'class' => 'rt-select2 filter-item',
|
133 |
-
'value' => get_post_meta($post->ID, 'order_by', true),
|
134 |
-
'options' => $rtTPG->rtPostOrderBy()
|
135 |
-
)
|
136 |
-
);
|
137 |
-
$html .= $rtTPG->rtFieldGenerator(
|
138 |
-
array(
|
139 |
-
'type' => 'radio',
|
140 |
-
'name' => 'order',
|
141 |
-
'label' => 'Order',
|
142 |
-
'class' => 'rt-select2 filter-item',
|
143 |
-
'alignment' => 'vertical',
|
144 |
-
'default' => 'DESC',
|
145 |
-
'value' => get_post_meta($post->ID, 'order', true),
|
146 |
-
'options' => $rtTPG->rtPostOrders()
|
147 |
-
)
|
148 |
-
);
|
149 |
-
$html .="</div>";
|
150 |
-
$html .="</div>";
|
151 |
-
$html .= "</div>";
|
152 |
-
$html .= "</div>";
|
153 |
-
}else if($key == 'author'){
|
154 |
-
$html .= "<div class='rt-tpg-filter {$key} hidden'>";
|
155 |
-
$html .= "<div class='rt-tpg-filter-item'>";
|
156 |
$html .= $rtTPG->rtFieldGenerator(
|
157 |
array(
|
158 |
-
'type'
|
159 |
-
'name'
|
160 |
-
'label'
|
161 |
-
'class'
|
162 |
-
'
|
163 |
-
|
164 |
-
|
|
|
165 |
)
|
166 |
);
|
167 |
-
$html .= "</div>";
|
168 |
-
$html .= "</div>";
|
169 |
-
}else if($key == 'tpg_post_status'){
|
170 |
-
$html .= "<div class='rt-tpg-filter {$key} hidden'>";
|
171 |
-
$html .= "<div class='rt-tpg-filter-item'>";
|
172 |
$html .= $rtTPG->rtFieldGenerator(
|
173 |
array(
|
174 |
-
'type'
|
175 |
-
'name'
|
176 |
-
'label'
|
177 |
-
'class'
|
178 |
-
'
|
179 |
-
'value'
|
180 |
-
|
181 |
-
'options' => $rtTPG->rtTPGPostStatus()
|
182 |
)
|
183 |
);
|
184 |
-
|
|
|
|
|
185 |
$html .= "</div>";
|
186 |
-
}else if($key == 's'){
|
187 |
-
$html .= "<div class='rt-tpg-filter {$key} hidden'>";
|
188 |
-
$html .= "<div class='rt-tpg-filter-item'>";
|
189 |
-
$html .= $rtTPG->rtFieldGenerator(
|
190 |
-
array(
|
191 |
-
'type' => 'text',
|
192 |
-
'name' => $key,
|
193 |
-
'label' => 'Search keyword',
|
194 |
-
'class' => 'filter-item full',
|
195 |
-
'value' => get_post_meta($post->ID, $key, true)
|
196 |
-
)
|
197 |
-
);
|
198 |
-
$html .= "</div>";
|
199 |
$html .= "</div>";
|
200 |
-
}
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
203 |
-
|
|
|
|
|
204 |
?>
|
205 |
</div>
|
206 |
</div>
|
2 |
global $rtTPG;
|
3 |
echo $rtTPG->rtFieldGenerator($rtTPG->rtTPGPostType());
|
4 |
$sHtml = null;
|
5 |
+
$sHtml .= '<div class="rt-field-wrapper">';
|
6 |
+
$sHtml .= '<div class="rt-label"><label>Common filters</label></div>';
|
7 |
+
$sHtml .= '<div class="rt-field">';
|
8 |
+
$sHtml .= $rtTPG->rtFieldGenerator($rtTPG->rtTPGCommonFilterFields(), true);
|
9 |
+
$sHtml .= '</div>';
|
10 |
$sHtml .= '</div>';
|
11 |
|
12 |
echo $sHtml;
|
16 |
<div class='rt-tpg-filter-container'>
|
17 |
<?php echo $rtTPG->rtFieldGenerator($rtTPG->rtTPAdvanceFilters()); ?>
|
18 |
<div class="rt-tpg-filter-holder">
|
19 |
+
<h3><?php esc_html_e("Advance filter options", "the-post-grid"); ?></h3>
|
20 |
<?php
|
21 |
+
$html = null;
|
22 |
+
$pt = get_post_meta($post->ID, 'tpg_post_type', true);
|
23 |
+
$advFilters = $rtTPG->rtTPAdvanceFilters();
|
24 |
+
foreach ($advFilters['options'] as $key => $filter) {
|
25 |
+
if ($key == 'tpg_taxonomy') {
|
26 |
+
$html .= "<div class='rt-tpg-filter taxonomy tpg_taxonomy hidden'>";
|
27 |
+
if (isset($pt) && $pt) {
|
28 |
+
$taxonomies = $rtTPG->rt_get_all_taxonomy_by_post_type($pt);
|
29 |
+
$taxA = get_post_meta($post->ID, $key);
|
30 |
+
$post_filter = get_post_meta($post->ID, 'post_filter');
|
31 |
+
$html .= "<div class='taxonomy-field'>";
|
32 |
+
if (is_array($post_filter) && !empty($post_filter) && in_array($key, $post_filter) && !empty($taxonomies)) {
|
33 |
+
$html .= $rtTPG->rtFieldGenerator(
|
34 |
+
array(
|
35 |
+
'type' => 'checkbox',
|
36 |
+
'name' => $key,
|
37 |
+
'label' => 'Taxonomy',
|
38 |
+
'id' => 'post-taxonomy',
|
39 |
+
"multiple" => true,
|
40 |
+
'options' => $taxonomies
|
41 |
+
)
|
42 |
+
);
|
43 |
+
} else {
|
44 |
+
$html .= '<div class="rt-field-wrapper">No Taxonomy found</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
$html .= "</div>";
|
47 |
+
$html .= "<div class='rt-tpg-filter-item term-filter-item hidden'>";
|
48 |
+
$html .= '<div class="rt-field-wrapper">';
|
49 |
+
$html .= '<div class="rt-label"></div>';
|
50 |
+
$html .= '<div class="rt-field term-filter-holder">';
|
51 |
+
if (is_array($taxA) && !empty($taxA)) {
|
52 |
+
foreach ($taxA as $tax) {
|
53 |
+
|
54 |
+
$html .= "<div class='term-filter-item-container {$tax}'>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
$html .= $rtTPG->rtFieldGenerator(
|
56 |
array(
|
57 |
+
'type' => 'select',
|
58 |
+
'name' => 'term_' . $tax,
|
59 |
+
'label' => ucfirst(str_replace('_', ' ', $tax)),
|
60 |
+
'class' => 'rt-select2 full',
|
61 |
+
'holderClass' => "term-filter-item {$tax}",
|
62 |
+
'value' => get_post_meta($post->ID, 'term_' . $tax),
|
63 |
+
"multiple" => true,
|
64 |
+
'options' => $rtTPG->rt_get_all_term_by_taxonomy($tax)
|
65 |
)
|
66 |
);
|
|
|
|
|
|
|
|
|
|
|
67 |
$html .= $rtTPG->rtFieldGenerator(
|
68 |
array(
|
69 |
+
'type' => 'select',
|
70 |
+
'name' => 'term_operator_' . $tax,
|
71 |
+
'label' => 'Operator',
|
72 |
+
'class' => 'rt-select2 full',
|
73 |
+
'holderClass' => "term-filter-item-operator {$tax}",
|
74 |
+
'value' => get_post_meta($post->ID, 'term_operator_' . $tax, true),
|
75 |
+
'options' => $rtTPG->rtTermOperators()
|
|
|
76 |
)
|
77 |
);
|
78 |
+
$html .= "</div>";
|
79 |
+
}
|
80 |
+
}
|
81 |
$html .= "</div>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
$html .= "</div>";
|
|
|
83 |
|
84 |
+
$html .= $rtTPG->rtFieldGenerator(
|
85 |
+
array(
|
86 |
+
'type' => 'select',
|
87 |
+
'name' => 'taxonomy_relation',
|
88 |
+
'label' => 'Relation',
|
89 |
+
'class' => 'rt-select2',
|
90 |
+
'holderClass' => "term-filter-item-relation " . (count($taxA) > 1 ? null : "hidden"),
|
91 |
+
'value' => get_post_meta($post->ID, 'taxonomy_relation', true),
|
92 |
+
'options' => $rtTPG->rtTermRelations()
|
93 |
+
)
|
94 |
+
);
|
95 |
+
|
96 |
+
$html .= "</div>";
|
97 |
+
} else {
|
98 |
+
|
99 |
+
$html .= "<div class='taxonomy-field'>";
|
100 |
+
$html .= "</div>";
|
101 |
+
$html .= "<div class='rt-tpg-filter-item'>";
|
102 |
+
$html .= '<div class="rt-field-wrapper">';
|
103 |
+
$html .= '<div class="rt-label">' . __("Terms", 'the-post-grid') . '</div>';
|
104 |
+
$html .= '<div class="field term-filter-holder">';
|
105 |
+
$html .= "</div>";
|
106 |
+
$html .= "</div>";
|
107 |
+
$html .= "</div>";
|
108 |
+
$html .= $rtTPG->rtFieldGenerator(
|
109 |
+
array(
|
110 |
+
'type' => 'select',
|
111 |
+
'name' => 'taxonomy_relation',
|
112 |
+
'label' => 'Relation',
|
113 |
+
'class' => 'rt-select2',
|
114 |
+
'holderClass' => "term-filter-item-relation hidden",
|
115 |
+
'default' => 'OR',
|
116 |
+
'options' => $rtTPG->rtTermRelations()
|
117 |
+
)
|
118 |
+
);
|
119 |
+
}
|
120 |
+
$html .= "</div>";
|
121 |
+
} else if ($key == 'order') {
|
122 |
+
$html .= "<div class='rt-tpg-filter {$key} hidden'>";
|
123 |
+
$html .= "<div class='rt-tpg-filter-item'>";
|
124 |
+
$html .= "<div class='rt-field-wrapper'>";
|
125 |
+
$html .= "<div class='rt-label'><label>" . __("Order Settings", 'the-post-grid') . "</label></div>";
|
126 |
+
$html .= "<div class='rt-field'>";
|
127 |
+
$html .= $rtTPG->rtFieldGenerator(
|
128 |
+
array(
|
129 |
+
'type' => 'select',
|
130 |
+
'name' => 'order_by',
|
131 |
+
'label' => 'Order by',
|
132 |
+
'class' => 'rt-select2 filter-item',
|
133 |
+
'value' => get_post_meta($post->ID, 'order_by', true),
|
134 |
+
'options' => $rtTPG->rtPostOrderBy()
|
135 |
+
)
|
136 |
+
);
|
137 |
+
$html .= $rtTPG->rtFieldGenerator(
|
138 |
+
array(
|
139 |
+
'type' => 'radio',
|
140 |
+
'name' => 'order',
|
141 |
+
'label' => 'Order',
|
142 |
+
'class' => 'rt-select2 filter-item',
|
143 |
+
'alignment' => 'vertical',
|
144 |
+
'default' => 'DESC',
|
145 |
+
'value' => get_post_meta($post->ID, 'order', true),
|
146 |
+
'options' => $rtTPG->rtPostOrders()
|
147 |
+
)
|
148 |
+
);
|
149 |
+
$html .= "</div>";
|
150 |
+
$html .= "</div>";
|
151 |
+
$html .= "</div>";
|
152 |
+
$html .= "</div>";
|
153 |
+
} else if ($key == 'author') {
|
154 |
+
$html .= "<div class='rt-tpg-filter {$key} hidden'>";
|
155 |
+
$html .= "<div class='rt-tpg-filter-item'>";
|
156 |
+
$html .= $rtTPG->rtFieldGenerator(
|
157 |
+
array(
|
158 |
+
'type' => 'select',
|
159 |
+
'name' => $key,
|
160 |
+
'label' => 'Author',
|
161 |
+
'class' => 'rt-select2 filter-item full',
|
162 |
+
'value' => get_post_meta($post->ID, $key),
|
163 |
+
"multiple" => true,
|
164 |
+
'options' => $rtTPG->rt_get_users()
|
165 |
+
)
|
166 |
+
);
|
167 |
+
$html .= "</div>";
|
168 |
+
$html .= "</div>";
|
169 |
+
} else if ($key == 'tpg_post_status') {
|
170 |
+
$html .= "<div class='rt-tpg-filter {$key} hidden'>";
|
171 |
+
$html .= "<div class='rt-tpg-filter-item'>";
|
172 |
+
$html .= $rtTPG->rtFieldGenerator(
|
173 |
+
array(
|
174 |
+
'type' => 'select',
|
175 |
+
'name' => $key,
|
176 |
+
'label' => 'Status',
|
177 |
+
'class' => 'rt-select2 filter-item full',
|
178 |
+
'default' => array('publish'),
|
179 |
+
'value' => get_post_meta($post->ID, $key),
|
180 |
+
"multiple" => true,
|
181 |
+
'options' => $rtTPG->rtTPGPostStatus()
|
182 |
+
)
|
183 |
+
);
|
184 |
+
$html .= "</div>";
|
185 |
+
$html .= "</div>";
|
186 |
+
} else if ($key == 's') {
|
187 |
+
$html .= "<div class='rt-tpg-filter {$key} hidden'>";
|
188 |
+
$html .= "<div class='rt-tpg-filter-item'>";
|
189 |
+
$html .= $rtTPG->rtFieldGenerator(
|
190 |
+
array(
|
191 |
+
'type' => 'text',
|
192 |
+
'name' => $key,
|
193 |
+
'label' => 'Search keyword',
|
194 |
+
'class' => 'filter-item full',
|
195 |
+
'value' => get_post_meta($post->ID, $key, true)
|
196 |
+
)
|
197 |
+
);
|
198 |
+
$html .= "</div>";
|
199 |
+
$html .= "</div>";
|
200 |
}
|
201 |
+
|
202 |
+
}
|
203 |
+
echo $html;
|
204 |
?>
|
205 |
</div>
|
206 |
</div>
|
lib/views/settings/settings.php
CHANGED
@@ -1,36 +1,23 @@
|
|
1 |
<?php global $rtTPG; ?>
|
2 |
-
<div class="wrap
|
3 |
-
<
|
4 |
-
|
5 |
-
<
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
</h3>
|
11 |
-
|
12 |
-
<div class="rt-setting-wrapper">
|
13 |
-
<div class="rt-response"></div>
|
14 |
-
<form id="rt-settings-form" onsubmit="rtTPGSettings(this); return false;">
|
15 |
<div class="rt-setting-holder">
|
16 |
-
|
17 |
</div>
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
<?php wp_nonce_field( $rtTPG->nonceText(), $rtTPG->nonceId() ); ?>
|
23 |
</form>
|
24 |
-
|
25 |
<div class="rt-response"></div>
|
26 |
</div>
|
27 |
-
|
28 |
-
|
29 |
-
<div class="pro-features">
|
30 |
-
<h3>PRO Version Features</h3>
|
31 |
-
<?php echo $rtTPG->get_pro_feature_list(); ?>
|
32 |
-
<p><a href="https://www.radiustheme.com/the-post-grid-pro-for-wordpress/" class="button-link"
|
33 |
-
target="_blank">Get Pro Version</a></p>
|
34 |
</div>
|
35 |
</div>
|
36 |
|
1 |
<?php global $rtTPG; ?>
|
2 |
+
<div class="wrap">
|
3 |
+
<h2><?php esc_html_e('The Post Grid Settings', 'the-post-grid'); ?></h2>
|
4 |
+
<div class="rt-settings-container">
|
5 |
+
<div class="rt-setting-title">
|
6 |
+
<h3><?php esc_html_e('General settings', "the-post-grid") ?></h3>
|
7 |
+
</div>
|
8 |
+
<div class="rt-setting-content">
|
9 |
+
<form id="rt-tpg-settings-form" onsubmit="rtTPGSettings(this); return false;">
|
|
|
|
|
|
|
|
|
|
|
10 |
<div class="rt-setting-holder">
|
11 |
+
<?php echo $rtTPG->rtFieldGenerator($rtTPG->rtTPGSettingFields(), true); ?>
|
12 |
</div>
|
13 |
+
<p class="submit"><input type="submit" name="submit" class="rt-admin-btn button button-primary rtSaveButton"
|
14 |
+
value="<?php esc_html_e('Save Changes', 'the-post-grid'); ?>"></p>
|
15 |
+
<?php wp_nonce_field($rtTPG->nonceText(), $rtTPG->nonceId()); ?>
|
|
|
|
|
16 |
</form>
|
|
|
17 |
<div class="rt-response"></div>
|
18 |
</div>
|
19 |
+
<div class="rt-pro-feature-content">
|
20 |
+
<?php rtTPG()->rt_plugin_sc_pro_information('settings'); ?>
|
|
|
|
|
|
|
|
|
|
|
21 |
</div>
|
22 |
</div>
|
23 |
|
the-post-grid.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: http://demo.radiustheme.com/wordpress/plugins/the-post-grid/
|
5 |
* Description: Fast & Easy way to display WordPress post in Grid, List & Isotope view ( filter by category, tag, author..) without a single line of coding.
|
6 |
* Author: RadiusTheme
|
7 |
-
* Version: 2.3.
|
8 |
* Text Domain: the-post-grid
|
9 |
* Domain Path: /languages
|
10 |
* Author URI: https://radiustheme.com/
|
4 |
* Plugin URI: http://demo.radiustheme.com/wordpress/plugins/the-post-grid/
|
5 |
* Description: Fast & Easy way to display WordPress post in Grid, List & Isotope view ( filter by category, tag, author..) without a single line of coding.
|
6 |
* Author: RadiusTheme
|
7 |
+
* Version: 2.3.3
|
8 |
* Text Domain: the-post-grid
|
9 |
* Domain Path: /languages
|
10 |
* Author URI: https://radiustheme.com/
|