PluginProbe
Post Grid Gutenberg Blocks – PostX / 5.0.41
Post Grid Gutenberg Blocks – PostX v5.0.41
5.0.41 5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 All 238 releases
← All changes | blocks/Post_Grid_2.php +389 -2239 2.1.15.0.41 View file →
@@ -1,2292 +1,442 @@
1 1 <?php
2 +
2 3 namespace ULTP\blocks;
3 4
4 -defined('ABSPATH') || exit;
5 +defined( 'ABSPATH' ) || exit;
5 6
6 -class Post_Grid_2{
7 +class Post_Grid_2 {
7 8
8 - public function __construct() {
9 - add_action('init', array($this, 'register'));
10 - }
9 + public function __construct() {
10 + add_action( 'init', array( $this, 'register' ) );
11 + }
11 12
12 - public function get_attributes($default = false){
13 + public function get_attributes() {
13 14
14 - $attributes = array(
15 - 'blockId' => [
16 - 'type' => 'string',
17 - 'default' => '',
18 - ],
19 - //--------------------------
20 - // Query Setting
21 - //--------------------------
22 - 'queryQuick' => [
23 - 'type' => 'string',
24 - 'default' =>'',
25 - ],
26 - 'queryNumber' => [
27 - 'type' => 'string',
28 - 'default' => 6,
29 - ],
30 - 'queryType' => [
31 - 'type' => 'string',
32 - 'default' => 'post'
33 - ],
34 - 'queryTax' => [
35 - 'type' => 'string',
36 - 'default' => 'category'
37 - ],
38 - 'queryCat' => [
39 - 'type' => 'string',
40 - 'default' => '[]',
41 - 'style' => [
42 - (object)[
43 - 'depends' => [(object)['key' => 'queryTax','condition' => '==','value' => 'category']]
44 - ],
45 - ],
46 - ],
47 - 'queryTag' => [
48 - 'type' => 'string',
49 - 'default' => '[]',
50 - 'style' => [
51 - (object)[
52 - 'depends' => [(object)['key' => 'queryTax','condition' => '==','value' => 'post_tag']]
53 - ],
54 - ],
55 - ],
56 - 'queryOrderBy' => [
57 - 'type' => 'string',
58 - 'default' => 'date',
59 - ],
60 - 'metaKey' => [
61 - 'type' => 'string',
62 - 'default' => 'custom_meta_key',
63 - 'style' => [
64 - (object)[
65 - 'depends' => [(object)['key' => 'queryOrderBy','condition' => '==','value' => 'meta_value_num']]
66 - ],
67 - ],
68 - ],
69 - 'queryOrder' => [
70 - 'type' => 'string',
71 - 'default' => 'desc',
72 - ],
73 - 'queryInclude' => [
74 - 'type' => 'string',
75 - 'default' => ''
76 - ],
77 - 'queryExclude' => [
78 - 'type' => 'string',
79 - 'default' => ''
80 - ],
81 - 'queryOffset' => [
82 - 'type' => 'string',
83 - 'default' => '0',
84 - ],
85 - //--------------------------
86 - // General Setting
87 - //--------------------------
88 - 'contentAlign' => [
89 - 'type' => 'string',
90 - 'default' => "left",
91 - 'style' => [
92 - (object)[
93 - 'depends' => [
94 - (object)['key'=>'contentAlign','condition'=>'==','value'=>'left'],
95 - ],
96 - 'selector'=>'{{ULTP}} .ultp-block-content { text-align:{{contentAlign}}; } {{ULTP}} .ultp-block-meta {justify-content: flex-start;}'
97 - ],
98 - (object)[
99 - 'depends' => [
100 - (object)['key'=>'contentAlign','condition'=>'==','value'=>'center'],
101 - ],
102 - 'selector'=>'{{ULTP}} .ultp-block-content { text-align:{{contentAlign}}; } {{ULTP}} .ultp-block-meta {justify-content: center;}'
103 - ],
104 - (object)[
105 - 'depends' => [
106 - (object)['key'=>'contentAlign','condition'=>'==','value'=>'right'],
107 - ],
108 - 'selector'=>'{{ULTP}} .ultp-block-content { text-align:{{contentAlign}}; } {{ULTP}} .ultp-block-meta {justify-content: flex-end;}'
109 - ],
110 - ],
111 - ],
112 - 'columns' => [
113 - 'type' => 'object',
114 - 'default' => (object)['lg' =>'3'],
115 - 'style' => [
116 - (object)[
117 - 'selector'=>'{{ULTP}} .ultp-block-row { grid-template-columns: repeat({{columns}}, 1fr); }'
118 - ],
119 - ],
120 - ],
121 - 'columnGridGap' => [
122 - 'type' => 'object',
123 - 'default' => (object)['lg' =>'20', 'unit' =>'px'],
124 - 'style' => [
125 - (object)[
126 - 'selector'=>'{{ULTP}} .ultp-block-row { grid-gap: {{columnGridGap}}; }'
127 - ],
128 - ],
129 - ],
130 - 'overlayHeight' => [
131 - 'type' => 'object',
132 - 'default' => (object)['lg' =>'250', 'unit' =>'px'],
133 - 'style' => [
134 - (object)[
135 - 'depends' => [
136 - (object)['key'=>'showImage','condition'=>'==','value'=>true],
137 - ],
138 - 'selector'=>'{{ULTP}} .ultp-block-item .ultp-block-image img, {{ULTP}} .ultp-block-item .ultp-block-empty-image {width: 100%; object-fit: cover; height: {{overlayHeight}}; }'
139 - ],
140 - ],
141 - ],
142 - 'titleShow' => [
143 - 'type' => 'boolean',
144 - 'default' => true,
145 - ],
146 - 'headingShow' => [
147 - 'type' => 'boolean',
148 - 'default' => true,
149 - ],
150 - 'excerptShow' => [
151 - 'type' => 'boolean',
152 - 'default' => false
153 - ],
154 - 'catShow' => [
155 - 'type' => 'boolean',
156 - 'default' => true,
157 - ],
158 - 'metaShow' => [
159 - 'type' => 'boolean',
160 - 'default' => true,
161 - ],
162 - 'showImage' => [
163 - 'type' => 'boolean',
164 - 'default' => true,
165 - ],
166 - 'filterShow' => [
167 - 'type' => 'boolean',
168 - 'default' => false,
169 - ],
170 - 'paginationShow' => [
171 - 'type' => 'boolean',
172 - 'default' => false,
173 - ],
174 -
175 - 'readMore' => [
176 - 'type' => 'boolean',
177 - 'default' => false,
178 - ],
179 - 'openInTab' => [
180 - 'type' => 'boolean',
181 - 'default' => false,
182 - ],
15 + return array(
16 + 'blockId' => '',
17 + 'previewImg' => '',
18 + 'advFilterEnable' => false,
19 + 'advPaginationEnable' => false,
20 + 'defQueryTax' => array(),
21 + 'advRelation' => 'AND',
22 + 'infiniteScroll' => false,
23 + // --------------------------
24 + // Query Setting
25 + // --------------------------
26 + 'queryQuick' => '',
27 + 'queryNumPosts' => (object) array( 'lg' => 6 ),
28 + // for compatibility since v.2.5.4
29 + 'queryNumber' => 6,
30 + 'queryType' => 'post',
31 + 'queryTax' => 'category',
32 + 'queryTaxValue' => '[]',
33 + 'queryRelation' => 'OR',
34 + 'queryOrderBy' => 'date',
35 + 'metaKey' => 'custom_meta_key',
36 + 'queryOrder' => 'desc',
37 + // Include Remove from Version 2.5.4
38 + 'queryInclude' => '',
39 + 'queryExclude' => '[]',
40 + 'queryAuthor' => '[]',
41 + 'queryOffset' => '0',
42 + 'queryExcludeTerm' => '[]',
43 + 'queryExcludeAuthor' => '[]',
44 + 'querySticky' => true,
45 + 'queryUnique' => '',
46 + 'queryPosts' => '[]',
47 + 'queryCustomPosts' => '[]',
48 + 'querySearch' => '',
49 + // --------------------------
50 + // General Setting
51 + // --------------------------
52 + 'columns' => (object) array(
53 + 'lg' => '3',
54 + 'sm' => '2',
55 + ),
56 + 'titleShow' => true,
57 + 'titleStyle' => 'none',
58 + 'headingShow' => true,
59 + 'excerptShow' => false,
60 + 'catShow' => true,
61 + 'metaShow' => true,
62 + 'showImage' => true,
63 + 'filterShow' => false,
64 + 'paginationShow' => false,
65 + 'readMore' => false,
66 + 'contentTag' => 'div',
67 + 'openInTab' => false,
68 + 'notFoundMessage' => 'No Post Found',
183 69
70 + // --------------------------
71 + // Overlay Content Setting/Style
72 + // --------------------------
73 + 'overlayContentPosition' => 'bottomPosition',
184 74
185 - //--------------------------
186 - // Overlay Content Setting/Style
187 - //--------------------------
188 - 'overlayContentPosition' => [
189 - 'type' => 'string',
190 - 'default' => 'bottomPosition',
191 - 'style' => [
192 - (object)[
193 - 'depends' => [
194 - (object)['key'=>'overlayContentPosition','condition'=>'==','value'=>'topPosition'],
195 - ],
196 - 'selector'=>'{{ULTP}} .ultp-block-content-topPosition { align-items:flex-start; }'
197 - ],
198 - (object)[
199 - 'depends' => [
200 - (object)['key'=>'overlayContentPosition','condition'=>'==','value'=>'middlePosition'],
201 - ],
202 - 'selector'=>'{{ULTP}} .ultp-block-content-middlePosition { align-items:center; }'
203 - ],
204 - (object)[
205 - 'depends' => [
206 - (object)['key'=>'overlayContentPosition','condition'=>'==','value'=>'bottomPosition'],
207 - ],
208 - 'selector'=>'{{ULTP}} .ultp-block-content-bottomPosition { align-items:flex-end; }'
209 - ],
210 - ]
211 - ],
212 - 'overlayBgColor' => [
213 - 'type' => 'object',
214 - 'default' => (object)['openColor' => 1,'type' => 'color', 'color' => ''],
215 - 'style' => [
216 - (object)[
217 - 'selector'=>'{{ULTP}} .ultp-block-content-inner'
218 - ],
219 - ],
220 - ],
221 - 'overlayWrapPadding' => [
222 - 'type' => 'object',
223 - 'default' => (object)['lg' =>(object)['top' => '20','bottom' => '20', 'left'=>'20','right'=>'20', 'unit' =>'px']],
224 - 'style' => [
225 - (object)[
226 - 'selector'=>'{{ULTP}} .ultp-block-content-inner { padding: {{overlayWrapPadding}}; }'
227 - ],
228 - ],
229 - ],
75 + // --------------------------
76 + // Heading Setting/Style
77 + // --------------------------
78 + 'headingText' => 'Post Grid #2',
79 + 'headingURL' => '',
80 + 'headingBtnText' => 'View More',
81 + 'headingStyle' => 'style1',
82 + 'headingTag' => 'h2',
83 + 'headingAlign' => 'left',
84 + 'subHeadingShow' => false,
85 + 'subHeadingText' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut sem augue. Sed at felis ut enim dignissim sodales.',
230 86
87 + // --------------------------
88 + // Title Setting/Style
89 + // --------------------------
90 + 'titleTag' => 'h3',
91 + 'titleAnimation' => '',
92 + 'titlePosition' => true,
93 + // 'titleColor' => '#fff',
94 + 'titleLength' => 0,
231 95
232 - //--------------------------
233 - // Heading Setting/Style
234 - //--------------------------
235 - 'headingText' => [
236 - 'type' => 'string',
237 - 'default' => 'Post Grid #2',
238 - ],
239 - 'headingURL' => [
240 - 'type' => 'string',
241 - 'default' => '',
242 - ],
243 - 'headingBtnText' => [
244 - 'type' => 'string',
245 - 'default' => 'View More',
246 - 'style' => [
247 - (object)[
248 - 'depends' => [
249 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style11'],
250 - ],
251 - ],
252 - ],
253 - ],
254 - 'headingStyle' => [
255 - 'type' => 'string',
256 - 'default' => 'style9',
257 - ],
258 - 'headingTag' => [
259 - 'type' => 'string',
260 - 'default' => 'h2',
261 - ],
262 - 'headingAlign' => [
263 - 'type' => 'string',
264 - 'default' => 'left',
265 - 'style' => [(object)['selector' => '{{ULTP}} .ultp-heading-inner, {{ULTP}} .ultp-sub-heading-inner { text-align:{{headingAlign}}; }']]
266 - ],
267 - 'headingTypo' => [
268 - 'type' => 'object',
269 - 'default' => (object)['openTypography' => 1,'size' => (object)['lg' => '20', 'unit' => 'px'], 'height' => (object)['lg' => '', 'unit' => 'px'],'decoration' => 'none', 'transform' => 'uppercase', 'family'=>'','weight'=>'700'],
270 - 'style' => [(object)['selector' => '{{ULTP}} .ultp-heading-wrap .ultp-heading-inner']]
271 - ],
272 - 'headingColor' => [
273 - 'type' => 'string',
274 - 'default' => '#0e1523',
275 - 'style' => [(object)['selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { color:{{headingColor}}; }']],
276 - ],
277 - 'headingBorderBottomColor' => [
278 - 'type' => 'string',
279 - 'default' => '#0e1523',
280 - 'style' => [
281 - (object)[
282 - 'depends' => [
283 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
284 - ],
285 - 'selector'=>'{{ULTP}} .ultp-heading-inner { border-bottom-color:{{headingBorderBottomColor}}; }'
286 - ],
287 - (object)[
288 - 'depends' => [
289 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style4'],
290 - ],
291 - 'selector'=>'{{ULTP}} .ultp-heading-inner { border-color:{{headingBorderBottomColor}}; }'
292 - ],
293 - (object)[
294 - 'depends' => [
295 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style6'],
296 - ],
297 - 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { background-color: {{headingBorderBottomColor}}; }'
298 - ],
299 - (object)[
300 - 'depends' => [
301 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style7'],
302 - ],
303 - 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { background-color: {{headingBorderBottomColor}}; }'
304 - ],
305 - (object)[
306 - 'depends' => [
307 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style8'],
308 - ],
309 - 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor}}; }'
310 - ],
311 - (object)[
312 - 'depends' => [
313 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style9'],
314 - ],
315 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor}}; }'
316 - ],
317 - (object)[
318 - 'depends' => [
319 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style10'],
320 - ],
321 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor}}; }'
322 - ],
323 - (object)[
324 - 'depends' => [
325 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
326 - ],
327 - 'selector'=>'{{ULTP}} .ultp-heading-inner { border-color:{{headingBorderBottomColor}}; }'
328 - ],
329 - (object)[
330 - 'depends' => [
331 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style14'],
332 - ],
333 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor}}; }'
334 - ],
335 - (object)[
336 - 'depends' => [
337 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style15'],
338 - ],
339 - 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { background-color:{{headingBorderBottomColor}}; }'
340 - ],
341 - (object)[
342 - 'depends' => [
343 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style16'],
344 - ],
345 - 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { background-color:{{headingBorderBottomColor}}; }'
346 - ],
347 - (object)[
348 - 'depends' => [
349 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style17'],
350 - ],
351 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor}}; }'
352 - ],
353 - (object)[
354 - 'depends' => [
355 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
356 - ],
357 - 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor}}; }'
358 - ],
359 - (object)[
360 - 'depends' => [
361 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style19'],
362 - ],
363 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before { border-color:{{headingBorderBottomColor}}; }'
364 - ],
365 - ],
366 - ],
367 - 'headingBorderBottomColor2' => [
368 - 'type' => 'string',
369 - 'default' => '#e5e5e5',
370 - 'style' => [
371 - (object)[
372 - 'depends' => [
373 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style8'],
374 - ],
375 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor2}}; }'
376 - ],
377 - (object)[
378 - 'depends' => [
379 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style10'],
380 - ],
381 - 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor2}}; }'
382 - ],
383 - (object)[
384 - 'depends' => [
385 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style14'],
386 - ],
387 - 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor2}}; }'
388 - ],
389 - (object)[
390 - 'depends' => [
391 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style19'],
392 - ],
393 - 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor2}}; }'
394 - ],
395 - ],
396 - ],
397 - 'headingBg' => [
398 - 'type' => 'string',
399 - 'default' => '#1740f5',
400 - 'style' => [
401 - (object)[
402 - 'depends' => [
403 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style5'],
404 - ],
405 - 'selector'=>'{{ULTP}} .ultp-heading-style5 .ultp-heading-inner span:before { border-color:{{headingBg}} transparent transparent; } {{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
406 - ],
407 - (object)[
408 - 'depends' => [
409 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style2'],
410 - ],
411 - 'selector'=>'{{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
412 - ],
413 - (object)[
414 - 'depends' => [
415 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
416 - ],
417 - 'selector'=>'{{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
418 - ],
419 - (object)[
420 - 'depends' => [
421 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style12'],
422 - ],
423 - 'selector'=>'{{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
424 - ],
425 - (object)[
426 - 'depends' => [
427 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
428 - ],
429 - 'selector'=>'{{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
430 - ],
431 - (object)[
432 - 'depends' => [
433 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
434 - ],
435 - 'selector'=>'{{ULTP}} .ultp-heading-inner { background-color:{{headingBg}}; }'
436 - ],
437 - (object)[
438 - 'depends' => [
439 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style20'],
440 - ],
441 - 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { border-color:{{headingBg}} transparent transparent; } {{ULTP}} .ultp-heading-inner { background-color:{{headingBg}}; }'
442 - ],
443 - ],
444 - ],
445 - 'headingBg2' => [
446 - 'type' => 'string',
447 - 'default' => '#e5e5e5',
448 - 'style' => [
449 - (object)[
450 - 'depends' => [
451 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style12'],
452 - ],
453 - 'selector'=>'{{ULTP}} .ultp-heading-inner { background-color:{{headingBg2}}; }'
454 - ],
455 - ],
456 - ],
457 - 'headingBtnTypo' => [
458 - 'type' => 'object',
459 - 'default' => (object)['openTypography' => 1,'size' => (object)['lg' => '14', 'unit' => 'px'], 'height' => (object)['lg' => '', 'unit' => 'px'],'decoration' => 'none','family'=>''],
460 - 'style' => [
461 - (object)[
462 - 'depends' => [
463 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style11'],
464 - ],
465 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-btn'
466 - ],
467 - ],
468 - ],
469 - 'headingBtnColor' => [
470 - 'type' => 'string',
471 - 'default' => '#1740f5',
472 - 'style' => [
473 - (object)[
474 - 'depends' => [
475 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style11'],
476 - ],
477 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-btn { color:{{headingBtnColor}}; } {{ULTP}} .ultp-heading-wrap .ultp-heading-btn svg { fill:{{headingBtnColor}}; }'
478 - ],
479 - ],
480 - ],
481 - 'headingBtnHoverColor' => [
482 - 'type' => 'string',
483 - 'default' => '#0a31da',
484 - 'style' => [
485 - (object)[
486 - 'depends' => [
487 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style11'],
488 - ],
489 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-btn:hover { color:{{headingBtnHoverColor}}; } {{ULTP}} .ultp-heading-wrap .ultp-heading-btn:hover svg { fill:{{headingBtnHoverColor}}; }'
490 - ],
491 - ],
492 - ],
493 -
494 - 'headingBorder' => [
495 - 'type' => 'string',
496 - 'default' => '3',
497 - 'style' => [
498 - (object)[
499 - 'depends' => [
500 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
501 - ],
502 - 'selector'=>'{{ULTP}} .ultp-heading-inner { border-bottom-width:{{headingBorder}}px; }'
503 - ],
504 - (object)[
505 - 'depends' => [
506 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style4'],
507 - ],
508 - 'selector'=>'{{ULTP}} .ultp-heading-inner { border-width:{{headingBorder}}px; }'
509 - ],
510 - (object)[
511 - 'depends' => [
512 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style6'],
513 - ],
514 - 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { width:{{headingBorder}}px; }'
515 - ],
516 - (object)[
517 - 'depends' => [
518 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style7'],
519 - ],
520 - 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { height:{{headingBorder}}px; }'
521 - ],
522 - (object)[
523 - 'depends' => [
524 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style8'],
525 - ],
526 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before, {{ULTP}} .ultp-heading-inner:after { height:{{headingBorder}}px; }'
527 - ],
528 - (object)[
529 - 'depends' => [
530 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style9'],
531 - ],
532 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before { height:{{headingBorder}}px; }'
533 - ],
534 - (object)[
535 - 'depends' => [
536 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style10'],
537 - ],
538 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before, {{ULTP}} .ultp-heading-inner:after { height:{{headingBorder}}px; }'
539 - ],
540 - (object)[
541 - 'depends' => [
542 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
543 - ],
544 - 'selector'=>'{{ULTP}} .ultp-heading-inner { border-width:{{headingBorder}}px; }'
545 - ],
546 - (object)[
547 - 'depends' => [
548 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style14'],
549 - ],
550 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before, {{ULTP}} .ultp-heading-inner:after { height:{{headingBorder}}px; }'
551 - ],
552 - (object)[
553 - 'depends' => [
554 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style15'],
555 - ],
556 - 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { height:{{headingBorder}}px; }'
557 - ],
558 - (object)[
559 - 'depends' => [
560 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style16'],
561 - ],
562 - 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { height:{{headingBorder}}px; }'
563 - ],
564 - (object)[
565 - 'depends' => [
566 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style17'],
567 - ],
568 - 'selector'=>'{{ULTP}} .ultp-heading-inner:before { height:{{headingBorder}}px; }'
569 - ],
570 - (object)[
571 - 'depends' => [
572 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style19'],
573 - ],
574 - 'selector'=>'{{ULTP}} .ultp-heading-inner:after { width:{{headingBorder}}px; }'
575 - ],
576 - (object)[
577 - 'depends' => [
578 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
579 - ],
580 - 'selector'=>'{{ULTP}} .ultp-heading-inner:after { width:{{headingBorder}}px; }'
581 - ],
582 - ],
583 - ],
584 - 'headingSpacing' => [
585 - 'type' => 'object',
586 - 'default' => (object)['lg'=>30, 'unit'=>'px'],
587 - 'style' => [(object)['selector'=>'{{ULTP}} .ultp-heading-wrap {margin-top:0; margin-bottom:{{headingSpacing}}; }']]
588 - ],
96 + // --------------------------
97 + // Content Setting/Style
98 + // --------------------------
99 + 'showSeoMeta' => false,
100 + 'showFullExcerpt' => false,
101 + 'excerptLimit' => 10,
589 102
590 - 'headingRadius' => [
591 - 'type' => 'object',
592 - 'default' => (object)['lg' =>(object)['top' => '','bottom' => '','left' => '', 'right' => '', 'unit' =>'px']],
593 - 'style' => [
594 - (object)[
595 - 'depends' => [
596 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style2'],
597 - ],
598 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { border-radius:{{headingRadius}}; }'
599 - ],
600 - (object)[
601 - 'depends' => [
602 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
603 - ],
604 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { border-radius:{{headingRadius}}; }'
605 - ],
606 - (object)[
607 - 'depends' => [
608 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style4'],
609 - ],
610 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
611 - ],
612 - (object)[
613 - 'depends' => [
614 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style5'],
615 - ],
616 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { border-radius:{{headingRadius}}; }'
617 - ],
618 - (object)[
619 - 'depends' => [
620 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style12'],
621 - ],
622 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
623 - ],
624 - (object)[
625 - 'depends' => [
626 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
627 - ],
628 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
629 - ],
630 - (object)[
631 - 'depends' => [
632 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
633 - ],
634 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
635 - ],
636 - (object)[
637 - 'depends' => [
638 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style20'],
639 - ],
640 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
641 - ],
642 - ]
643 - ],
103 + // --------------------------
104 + // Category Setting/Style
105 + // --------------------------
106 + 'maxTaxonomy' => '30',
107 + 'taxonomy' => 'category',
108 + 'catStyle' => 'classic',
109 + 'catPosition' => 'aboveTitle',
110 + 'customCatColor' => false,
111 + 'seperatorLink' => admin_url( 'edit-tags.php?taxonomy=category' ),
112 + 'onlyCatColor' => false,
644 113
114 + // --------------------------
115 + // Meta Setting/Style
116 + // --------------------------
117 + 'metaPosition' => 'top',
118 + 'metaStyle' => 'icon',
119 + 'authorLink' => true,
120 + 'metaSeparator' => 'dot',
121 + 'metaList' => '["metaAuthor","metaDate"]',
122 + 'metaMinText' => 'min read',
123 + 'metaAuthorPrefix' => 'By',
124 + 'metaDateFormat' => 'M j, Y',
645 125
646 - 'headingPadding' => [
647 - 'type' => 'object',
648 - 'default' => (object)['lg' =>(object)['top' => '','bottom' => '','left' => '', 'right' => '', 'unit' =>'px']],
649 - 'style' => [
650 - (object)[
651 - 'depends' => [
652 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style2'],
653 - ],
654 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
655 - ],
656 - (object)[
657 - 'depends' => [
658 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
659 - ],
660 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
661 - ],
662 - (object)[
663 - 'depends' => [
664 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style4'],
665 - ],
666 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
667 - ],
668 - (object)[
669 - 'depends' => [
670 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style5'],
671 - ],
672 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
673 - ],
674 - (object)[
675 - 'depends' => [
676 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style6'],
677 - ],
678 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
679 - ],
680 - (object)[
681 - 'depends' => [
682 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style12'],
683 - ],
684 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
685 - ],
686 - (object)[
687 - 'depends' => [
688 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
689 - ],
690 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
691 - ],
692 - (object)[
693 - 'depends' => [
694 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
695 - ],
696 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
697 - ],
698 - (object)[
699 - 'depends' => [
700 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style19'],
701 - ],
702 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
703 - ],
704 - (object)[
705 - 'depends' => [
706 - (object)['key'=>'headingStyle','condition'=>'==','value'=>'style20'],
707 - ],
708 - 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
709 - ],
710 - ]
711 - ],
712 - 'subHeadingShow' => [
713 - 'type' => 'boolean',
714 - 'default' => false,
715 - ],
716 - 'subHeadingText' => [
717 - 'type' => 'string',
718 - 'default' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut sem augue. Sed at felis ut enim dignissim sodales.',
719 - 'style' => [
720 - (object)[
721 - 'depends' => [
722 - (object)['key'=>'subHeadingShow','condition'=>'==','value'=>true],
723 - ],
724 - ],
725 - ],
726 - ],
727 - 'subHeadingTypo' => [
728 - 'type' => 'object',
729 - 'default' => (object)['openTypography'=>1,'size'=>(object)['lg'=>'16', 'unit'=>'px'], 'spacing'=>(object)[ 'lg'=>'0', 'unit'=>'px'], 'height'=>(object)[ 'lg'=>'27', 'unit'=>'px'],'decoration'=>'none','transform' => 'capitalize','family'=>'','weight'=>'500'],
730 - 'style' => [
731 - (object)[
732 - 'depends' => [
733 - (object)['key'=>'subHeadingShow','condition'=>'==','value'=>true],
734 - ],
735 - 'selector'=>'{{ULTP}} .ultp-sub-heading div'
736 - ],
737 - ],
738 - ],
739 - 'subHeadingColor' => [
740 - 'type' => 'string',
741 - 'default' => '#989898',
742 - 'style' => [
743 - (object)[
744 - 'depends' => [
745 - (object)['key'=>'subHeadingShow','condition'=>'==','value'=>true],
746 - ],
747 - 'selector'=>'{{ULTP}} .ultp-sub-heading div{ color:{{subHeadingColor}}; }'
748 - ],
749 - ],
750 - ],
751 - 'subHeadingSpacing' => [
752 - 'type' => 'object',
753 - 'default' => (object)['lg' =>(object)['unit' =>'px']],
754 - 'style' => [
755 - (object)[
756 - 'depends' => [
757 - (object)['key'=>'subHeadingShow','condition'=>'==','value'=>true],
758 - ],
759 - 'selector'=>'{{ULTP}} div.ultp-sub-heading-inner{ margin:{{subHeadingSpacing}}; }'
760 - ],
761 - ],
762 - ],
126 + // --------------------------
127 + // Image Setting/Style
128 + // --------------------------
129 + 'imgCrop' => ( ultimate_post()->get_setting( 'disable_image_size' ) == 'yes' ? 'full' : 'ultp_layout_landscape' ),
130 + 'imgAnimation' => 'zoomOut',
131 + 'imgOverlay' => true,
132 + 'imgOverlayType' => 'flat',
133 + 'fallbackEnable' => true,
134 + 'fallbackImg' => '',
135 + 'imgSrcset' => false,
136 + 'imgLazy' => false,
763 137
764 - //--------------------------
765 - // Title Setting/Style
766 - //--------------------------
767 - 'titleTag' => [
768 - 'type' => 'string',
769 - 'default' => 'h3',
770 - ],
771 - 'titleAnimation' => [
772 - 'type' => 'string',
773 - 'default' => '',
774 - ],
775 - 'titlePosition' => [
776 - 'type' => 'boolean',
777 - 'default' => true,
778 - ],
779 - 'titleColor' => [
780 - 'type' => 'string',
781 - 'default' => '#fff',
782 - 'style' => [
783 - (object)[
784 - 'depends' => [
785 - (object)['key'=>'titleShow','condition'=>'==','value'=>true],
786 - ],
787 - 'selector'=>'{{ULTP}} .ultp-block-content .ultp-block-title a { color:{{titleColor}}; }'
788 - ],
789 - ],
790 - ],
791 - 'titleHoverColor' => [
792 - 'type' => 'string',
793 - 'default' => 'rgba(255,255,255,0.70)',
794 - 'style' => [
795 - (object)[
796 - 'depends' => [
797 - (object)['key'=>'titleShow','condition'=>'==','value'=>true],
798 - ],
799 - 'selector'=>'{{ULTP}} .ultp-block-content .ultp-block-title a:hover { color:{{titleHoverColor}}; }'
800 - ],
801 - ],
802 - ],
803 - 'titleTypo' => [
804 - 'type' => 'object',
805 - 'default' => (object)['openTypography'=>1,'size'=>(object)['lg'=>'20', 'unit'=>'px'], 'height'=>(object)['lg'=>'26', 'unit'=>'px'], 'decoration'=>'none','family'=>'','weight'=>'600'],
806 - 'style' => [
807 - (object)[
808 - 'depends' => [
809 - (object)['key'=>'titleShow','condition'=>'==','value'=>true],
810 - ],
811 - 'selector'=>'{{ULTP}} .ultp-block-item .ultp-block-title, {{ULTP}} .ultp-block-item .ultp-block-title a'
812 - ],
813 - ],
814 - ],
815 - 'titlePadding' => [
816 - 'type' => 'object',
817 - 'default' => (object)['lg'=>(object)['top'=>10,'bottom'=>5, 'unit'=>'px']],
818 - 'style' => [
819 - (object)[
820 - 'depends' => [
821 - (object)['key'=>'titleShow','condition'=>'==','value'=>true],
822 - ],
823 - 'selector'=>'{{ULTP}} .ultp-block-content .ultp-block-title { padding:{{titlePadding}}; }'
824 - ],
825 - ],
826 - ],
138 + /*
139 + ============================
140 + Video Style
141 + ============================*/
142 + 'vidIconEnable' => true,
143 + 'popupAutoPlay' => true,
144 + 'iconSize' => (object) array(
145 + 'lg' => '40',
146 + 'sm' => '30',
147 + 'xs' => '30',
148 + 'unit' => 'px',
149 + ),
150 + // by default should be off
151 + 'enablePopup' => false,
152 + 'enablePopupTitle' => true,
827 153
828 - //--------------------------
829 - // Content Setting/Style
830 - //--------------------------
831 - 'showFullExcerpt' => [
832 - 'type' => 'boolean',
833 - 'default' => false,
834 - ],
835 - 'excerptLimit' => [
836 - 'type' => 'string',
837 - 'default' => 20,
838 - 'style' => [
839 - (object)[
840 - 'depends' => [
841 - (object)['key'=>'showFullExcerpt','condition'=>'==','value'=>false],
842 - ],
843 - ],
844 - ],
845 - ],
846 - 'excerptColor' => [
847 - 'type' => 'string',
848 - 'default' => '#fff',
849 - 'style' => [
850 - (object)[
851 - 'depends' => [
852 - (object)['key'=>'excerptShow','condition'=>'==','value'=>true],
853 - ],
854 - 'selector'=>'{{ULTP}} .ultp-block-excerpt { color:{{excerptColor}}; }'
855 - ],
856 - ],
857 - ],
858 - 'excerptTypo' => [
859 - 'type' => 'object',
860 - 'default' => (object)['openTypography' => 1,'size' => (object)['lg' =>14, 'unit' =>'px'],'height' => (object)['lg' =>20, 'unit' =>'px'], 'decoration' => 'none','family'=>''],
861 - 'style' => [
862 - (object)[
863 - 'depends' => [
864 - (object)['key'=>'excerptShow','condition'=>'==','value'=>true],
865 - ],
866 - 'selector'=>'{{ULTP}} .ultp-block-excerpt'
867 - ],
868 - ],
869 - ],
870 - 'excerptPadding' => [
871 - 'type' => 'object',
872 - 'default' => (object)['lg' =>(object)['top' => 5,'bottom' => '', 'unit' =>'px']],
873 - 'style' => [
874 - (object)[
875 - 'depends' => [
876 - (object)['key'=>'excerptShow','condition'=>'==','value'=>true],
877 - ],
878 - 'selector'=>'{{ULTP}} .ultp-block-excerpt{ padding: {{excerptPadding}}; }'
879 - ],
880 - ],
881 - ],
154 + // --------------------------
155 + // Read more Setting/Style
156 + // --------------------------
157 + 'readMoreText' => '',
158 + 'readMoreIcon' => 'rightArrowLg',
882 159
883 - //--------------------------
884 - // Category Setting/Style
885 - //--------------------------
886 - 'catStyle' => [
887 - 'type' => 'string',
888 - 'default' => 'classic',
889 - ],
890 - 'catPosition' => [
891 - 'type' => 'string',
892 - 'default' => 'aboveTitle',
893 - ],
894 - 'customCatColor' => [
895 - 'type' => 'boolean',
896 - 'default' => false,
897 - ],
898 - 'seperatorLink' => [
899 - 'type' => 'string',
900 - 'default' => admin_url( 'edit-tags.php?taxonomy=category' ),
901 - 'style' => [
902 - (object)[
903 - 'depends' => [
904 - (object)['key'=>'customCatColor','condition'=>'==','value'=>true],
905 - ]
906 - ]
907 - ]
908 - ],
909 - 'onlyCatColor' => [
910 - 'type' => 'boolean',
911 - 'default' => false,
912 - 'style' => [
913 - (object)[
914 - 'depends' => [
915 - (object)['key'=>'customCatColor','condition'=>'==','value'=>true],
916 - ]
917 - ]
918 - ]
919 - ],
920 - 'catLineWidth' => [
921 - 'type' => 'object',
922 - 'default' => (object)['lg'=>'20'],
923 - 'style' => [
924 - (object)[
925 - 'depends' => [
926 - (object)['key'=>'catStyle','condition'=>'!=','value'=>'classic'],
927 - ],
928 - 'selector' => '{{ULTP}} .ultp-category-borderRight .ultp-category-in:before, {{ULTP}} .ultp-category-borderBoth .ultp-category-in:before, {{ULTP}} .ultp-category-borderBoth .ultp-category-in:after, {{ULTP}} .ultp-category-borderLeft .ultp-category-in:before { width:{{catLineWidth}}px; }'
929 - ],
930 - ]
931 - ],
932 - 'catLineSpacing' => [
933 - 'type' => 'object',
934 - 'default' => (object)['lg'=>'30'],
935 - 'style' => [
936 - (object)[
937 - 'depends' => [
938 - (object)['key'=>'catStyle','condition'=>'!=','value'=>'classic'],
939 - ],
940 - 'selector' => '{{ULTP}} .ultp-category-borderBoth .ultp-category-in { padding-left: {{catLineSpacing}}px; padding-right: {{catLineSpacing}}px; }
941 - {{ULTP}} .ultp-category-borderLeft .ultp-category-in { padding-left: {{catLineSpacing}}px; }
942 - {{ULTP}} .ultp-category-borderRight .ultp-category-in { padding-right:{{catLineSpacing}}px; }'
943 - ],
944 - ]
945 - ],
946 - 'catLineColor' => [
947 - 'type' => 'string',
948 - 'default' => '#000',
949 - 'style' => [
950 - (object)[
951 - 'depends' => [
952 - (object)['key'=>'catStyle','condition'=>'!=','value'=>'classic'],
953 - ],
954 - 'selector' => '{{ULTP}} .ultp-category-borderRight .ultp-category-in:before, {{ULTP}} .ultp-category-borderLeft .ultp-category-in:before, {{ULTP}} .ultp-category-borderBoth .ultp-category-in:after, {{ULTP}} .ultp-category-borderBoth .ultp-category-in:before { background:{{catLineColor}}; }'
955 - ],
956 - ]
957 - ],
958 - 'catLineHoverColor' => [
959 - 'type' => 'string',
960 - 'default' => '#1740f5',
961 - 'style' => [
962 - (object)[
963 - 'depends' => [
964 - (object)['key'=>'catStyle','condition'=>'!=','value'=>'classic'],
965 - ],
966 - 'selector' => '{{ULTP}} .ultp-category-borderBoth:hover .ultp-category-in:before, {{ULTP}} .ultp-category-borderBoth:hover .ultp-category-in:after, {{ULTP}} .ultp-category-borderLeft:hover .ultp-category-in:before, {{ULTP}} .ultp-category-borderRight:hover .ultp-category-in:before { background:{{catLineHoverColor}}; }'
967 - ],
968 - ]
969 - ],
970 - 'catTypo' => [
971 - 'type' => 'object',
972 - 'default' => (object)['openTypography' => 1, 'size' => (object)['lg' =>11, 'unit' =>'px'], 'height' => (object)['lg' =>15, 'unit' =>'px'], 'spacing' => (object)['lg' =>1, 'unit' =>'px'], 'transform' => 'uppercase', 'weight' => '400', 'decoration' => 'none','family'=>'' ],
973 - 'style' => [
974 - (object)[
975 - 'depends' => [
976 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
977 - ],
978 - 'selector'=>'{{ULTP}} .ultp-block-item .ultp-category-grid a'
979 - ],
980 - ],
981 - ],
982 - 'catColor' => [
983 - 'type' => 'string',
984 - 'default' => '#fff',
985 - 'style' => [
986 - (object)[
987 - 'depends' => [
988 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
989 - (object)['key'=>'customCatColor','condition'=>'!=','value'=>true],
990 - ],
991 - 'selector'=>'{{ULTP}} .ultp-category-grid a { color:{{catColor}}; }'
992 - ],
993 - ],
994 - ],
995 - 'catBgColor' => [
996 - 'type' => 'object',
997 - 'default' => (object)['openColor' => 1,'type' => 'color', 'color' => '#000'],
998 - 'style' => [
999 - (object)[
1000 - 'depends' => [
1001 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
1002 - (object)['key'=>'customCatColor','condition'=>'!=','value'=>true],
1003 - ],
1004 - 'selector'=>'{{ULTP}} .ultp-category-grid a'
1005 - ],
1006 - ],
1007 - ],
1008 - 'catBorder' => [
1009 - 'type' => 'object',
1010 - 'default' => (object)['openBorder'=>0, 'width' => (object)[ 'top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid' ],
1011 - 'style' => [
1012 - (object)[
1013 - 'depends' => [
1014 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
1015 - (object)['key'=>'onlyCatColor','condition'=>'!=','value'=>true],
1016 - ],
1017 - 'selector'=>'{{ULTP}} .ultp-category-grid a'
1018 - ],
1019 - ],
1020 - ],
1021 - 'catRadius' => [
1022 - 'type' => 'object',
1023 - 'default' => (object)['lg' =>'2', 'unit' =>'px'],
1024 - 'style' => [
1025 - (object)[
1026 - 'depends' => [
1027 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
1028 - (object)['key'=>'onlyCatColor','condition'=>'!=','value'=>true],
1029 - ],
1030 - 'selector'=>'{{ULTP}} .ultp-category-grid a { border-radius:{{catRadius}}; }'
1031 - ],
1032 - ],
1033 - ],
1034 - 'catHoverColor' => [
1035 - 'type' => 'string',
1036 - 'default' => '#fff',
1037 - 'style' => [
1038 - (object)[
1039 - 'depends' => [
1040 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
1041 - (object)['key'=>'customCatColor','condition'=>'!=','value'=>true],
1042 - ],
1043 - 'selector'=>'{{ULTP}} .ultp-category-grid a:hover { color:{{catHoverColor}}; }'
1044 - ],
1045 - ],
1046 - ],
1047 - 'catBgHoverColor' => [
1048 - 'type' => 'object',
1049 - 'default' => (object)['openColor' => 1, 'type' => 'color', 'color' => '#1740f5'],
1050 - 'style' => [
1051 - (object)[
1052 - 'depends' => [
1053 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
1054 - (object)['key'=>'customCatColor','condition'=>'!=','value'=>true],
1055 - ],
1056 - 'selector'=>'{{ULTP}} .ultp-category-grid a:hover'
1057 - ],
1058 - ],
1059 - ],
1060 - 'catHoverBorder' => [
1061 - 'type' => 'object',
1062 - 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
1063 - 'style' => [
1064 - (object)[
1065 - 'depends' => [
1066 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
1067 - (object)['key'=>'onlyCatColor','condition'=>'!=','value'=>true],
1068 - ],
1069 - 'selector'=>'{{ULTP}} .ultp-category-grid a:hover'
1070 - ],
1071 - ],
1072 - ],
1073 - 'catSacing' => [
1074 - 'type' => 'object',
1075 - 'default' => (object)['lg' =>(object)['top' => 5,'bottom' => 5,'left' => 0,'right' => 0, 'unit' =>'px']],
1076 - 'style' => [
1077 - (object)[
1078 - 'depends' => [
1079 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
1080 - ],
1081 - 'selector'=>'{{ULTP}} .ultp-category-grid { margin:{{catSacing}}; }'
1082 - ],
1083 - ],
1084 - ],
1085 - 'catPadding' => [
1086 - 'type' => 'object',
1087 - 'default' => (object)['lg' =>(object)['top' => 3,'bottom' => 3,'left' => 7,'right' => 7, 'unit' =>'px']],
1088 - 'style' => [
1089 - (object)[
1090 - 'depends' => [
1091 - (object)['key'=>'catShow','condition'=>'==','value'=>true],
1092 - (object)['key'=>'onlyCatColor','condition'=>'!=','value'=>true],
1093 - ],
1094 - 'selector'=>'{{ULTP}} .ultp-category-grid a { padding:{{catPadding}}; }'
1095 - ],
1096 - ],
1097 - ],
160 + // --------------------------
161 + // Filter Setting/Style
162 + // --------------------------
163 + 'filterBelowTitle' => false,
164 + 'filterType' => 'category',
165 + 'filterText' => 'all',
166 + 'filterValue' => '[]',
167 + 'filterMobile' => true,
168 + 'filterMobileText' => 'More',
1098 169
1099 - //--------------------------
1100 - // Meta Setting/Style
1101 - //--------------------------
1102 - 'metaPosition' => [
1103 - 'type' => 'string',
1104 - 'default' => 'top',
1105 - ],
1106 - 'metaStyle' => [
1107 - 'type' => 'string',
1108 - 'default' => 'icon',
1109 - ],
1110 - 'metaSeparator' => [
1111 - 'type' => 'string',
1112 - 'default' => 'dot',
1113 - ],
1114 - 'metaList' => [
1115 - 'type' => 'string',
1116 - 'default' => '["metaAuthor","metaDate"]',
1117 - ],
1118 - 'metaTypo' => [
1119 - 'type' => 'object',
1120 - 'default' => (object)['openTypography' => 1,'size' => (object)['lg' =>12, 'unit' =>'px'],'height' => (object)['lg' =>20, 'unit' =>'px'], 'decoration' => 'none','family'=>''],
1121 - 'style' => [
1122 - (object)[
1123 - 'depends' => [
1124 - (object)['key'=>'metaShow','condition'=>'==','value'=>true],
1125 - ],
1126 - 'selector'=>'{{ULTP}} .ultp-block-meta span, {{ULTP}} .ultp-block-item .ultp-block-meta span a'
1127 - ],
1128 - ],
1129 - ],
1130 - 'metaColor' => [
1131 - 'type' => 'string',
1132 - 'default' => 'rgba(255,255,255,0.90)',
1133 - 'style' => [
1134 - (object)[
1135 - 'depends' => [
1136 - (object)['key'=>'metaShow','condition'=>'==','value'=>true],
1137 - ],
1138 - 'selector'=>'{{ULTP}} .ultp-block-meta span { color: {{metaColor}}; } {{ULTP}} .ultp-block-meta span svg { fill: {{metaColor}}; } {{ULTP}} .ultp-block-meta span a { color: {{metaColor}}; }{{ULTP}} .ultp-block-meta-dot span:after { background:{{metaColor}}; } {{ULTP}} .ultp-block-meta span:after { color:{{metaColor}}; }'
1139 - ],
1140 - ],
1141 - ],
1142 - 'metaHoverColor' => [
1143 - 'type' => 'string',
1144 - 'default' => '#f5f5f5',
1145 - 'style' => [
1146 - (object)[
1147 - 'depends' => [
1148 - (object)['key'=>'metaShow','condition'=>'==','value'=>true],
1149 - ],
1150 - 'selector'=>'{{ULTP}} .ultp-block-meta span a:hover { color: {{metaHoverColor}}; }'
1151 - ],
1152 - ],
1153 - ],
1154 - 'metaBorder' => [
1155 - 'type' => 'object',
1156 - 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => '0', 'bottom' => '0', 'left' => '0'],'color' => '#009fd4','type' => 'solid'],
1157 - 'style' => [
1158 - (object)[
1159 - 'depends' => [
1160 - (object)['key'=>'metaShow','condition'=>'==','value'=>true],
1161 - ],
1162 - 'selector'=>'{{ULTP}} .ultp-block-meta'
1163 - ],
1164 - ],
1165 - ],
1166 - 'metaSpacing' => [
1167 - 'type' => 'object',
1168 - 'default' => (object)['lg' =>'15', 'unit' =>'px'],
1169 - 'style' => [
1170 - (object)[
1171 - 'depends' => [
1172 - (object)['key'=>'metaShow','condition'=>'==','value'=>true],
1173 - ],
1174 - 'selector'=>'{{ULTP}} .ultp-block-meta span { margin-right:{{metaSpacing}}; } {{ULTP}} .ultp-block-meta span { padding-left: {{metaSpacing}}; } .rtl {{ULTP}} .ultp-block-meta span {margin-right:0; margin-left:{{metaSpacing}}; } .rtl {{ULTP}} .ultp-block-meta span { padding-left:0; padding-right: {{metaSpacing}}; }'
1175 - ],
1176 - ],
1177 - ],
1178 - 'metaMargin' => [
1179 - 'type' => 'object',
1180 - 'default' => (object)['lg' =>(object)['top' => '5','bottom' => '', 'left'=>'','right'=>'', 'unit' =>'px']],
1181 - 'style' => [
1182 - (object)[
1183 - 'depends' => [
1184 - (object)['key'=>'metaShow','condition'=>'==','value'=>true],
1185 - ],
1186 - 'selector'=>'{{ULTP}} .ultp-block-meta { margin:{{metaMargin}}; }'
1187 - ],
1188 - ],
1189 - ],
1190 - 'metaPadding' => [
1191 - 'type' => 'object',
1192 - 'default' => (object)['lg' =>(object)['top' => '5','bottom' => '5', 'left'=>'','right'=>'', 'unit' =>'px']],
1193 - 'style' => [
1194 - (object)[
1195 - 'depends' => [
1196 - (object)['key'=>'metaShow','condition'=>'==','value'=>true],
1197 - ],
1198 - 'selector'=>'{{ULTP}} .ultp-block-meta { padding:{{metaPadding}}; }'
1199 - ],
1200 - ],
1201 - ],
1202 - 'metaBorder' => [
1203 - 'type' => 'object',
1204 - 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => '0', 'bottom' => '0', 'left' => '0'],'color' => '#009fd4','type' => 'solid'],
1205 - 'style' => [
1206 - (object)[
1207 - 'depends' => [
1208 - (object)['key'=>'metaShow','condition'=>'==','value'=>true],
1209 - ],
1210 - 'selector'=>'{{ULTP}} .ultp-block-meta'
1211 - ],
1212 - ],
1213 - ],
1214 - 'metaBg' => [
1215 - 'type' => 'string',
1216 - 'default' => '',
1217 - 'style' => [
1218 - (object)[
1219 - 'depends' => [
1220 - (object)['key'=>'metaShow','condition'=>'==','value'=>true],
1221 - ],
1222 - 'selector'=>'{{ULTP}} .ultp-block-meta { background:{{metaBg}}; }'
1223 - ],
1224 - ],
1225 - ],
170 + // --------------------------
171 + // Pagination Setting/Style
172 + // --------------------------
173 + 'paginationType' => 'pagination',
174 + 'loadMoreText' => 'Load More',
175 + 'paginationText' => 'Previous|Next',
176 + 'paginationNav' => 'textArrow',
177 + 'paginationAjax' => true,
178 + 'navPosition' => 'topRight',
1226 179
180 + // --------------------------
181 + // Wrapper Style
182 + // --------------------------
183 + 'advanceId' => '',
184 + 'advanceZindex' => '',
185 + 'hideExtraLarge' => false,
186 + 'hideTablet' => false,
187 + 'hideMobile' => false,
188 + 'advanceCss' => '',
189 + 'currentPostId' => '',
1227 190
1228 - //--------------------------
1229 - // Image Setting/Style
1230 - //--------------------------
1231 - 'imgCrop' => [
1232 - 'type' => 'string',
1233 - 'default' => 'ultp_layout_landscape',
1234 - 'depends' => [(object)['key' => 'showImage','condition' => '==','value' => 'true']]
1235 - ],
1236 - 'imgAnimation' => [
1237 - 'type' => 'string',
1238 - 'default' => 'zoomOut',
1239 - ],
1240 - 'imgGrayScale' => [
1241 - 'type' => 'object',
1242 - 'default' => (object)['lg' =>'0', 'unit' =>'%'],
1243 - 'style' => [
1244 - (object)[
1245 - 'depends' => [
1246 - (object)['key'=>'showImage','condition'=>'==','value'=>true],
1247 - ],
1248 - 'selector'=>'{{ULTP}} .ultp-block-image img { filter: grayscale({{imgGrayScale}}); }'
1249 - ],
1250 - ],
1251 - ],
1252 - 'imgHoverGrayScale' => [
1253 - 'type' => 'object',
1254 - 'default' => (object)['lg' =>'0', 'unit' =>'%'],
1255 - 'style' => [
1256 - (object)[
1257 - 'depends' => [
1258 - (object)['key'=>'showImage','condition'=>'==','value'=>true],
1259 - ],
1260 - 'selector'=>'{{ULTP}} .ultp-block-item:hover .ultp-block-image img { filter: grayscale({{imgHoverGrayScale}}); }'
1261 - ],
1262 - ],
1263 - ],
1264 - 'imgRadius' => [
1265 - 'type' => 'object',
1266 - 'default' => (object)['lg' =>'', 'unit' =>'px'],
1267 - 'style' => [
1268 - (object)[
1269 - 'depends' => [
1270 - (object)['key'=>'showImage','condition'=>'==','value'=>true],
1271 - ],
1272 - 'selector'=>'{{ULTP}} .ultp-block-content-wrap, {{ULTP}} .ultp-block-image { border-radius:{{imgRadius}}; }'
1273 - ],
1274 - ],
1275 - ],
1276 - 'imgHoverRadius' => [
1277 - 'type' => 'object',
1278 - 'default' => (object)['lg' =>'', 'unit' =>'px'],
1279 - 'style' => [
1280 - (object)[
1281 - 'depends' => [
1282 - (object)['key'=>'showImage','condition'=>'==','value'=>true],
1283 - ],
1284 - 'selector'=>'{{ULTP}} .ultp-block-content-wrap:hover, {{ULTP}} .ultp-block-content-wrap:hover .ultp-block-image { border-radius:{{imgHoverRadius}}; }'
1285 - ],
1286 - ],
1287 - ],
1288 - 'imgShadow' => [
1289 - 'type' => 'object',
1290 - 'default' => (object)['openShadow' => 0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4'],
1291 - 'style' => [
1292 - (object)[
1293 - 'depends' => [
1294 - (object)['key'=>'showImage','condition'=>'==','value'=>true],
1295 - ],
1296 - 'selector'=>'{{ULTP}} .ultp-block-content-overlay'
1297 - ],
1298 - ],
1299 - ],
1300 - 'imgHoverShadow' => [
1301 - 'type' => 'object',
1302 - 'default' => (object)['openShadow' => 0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4'],
1303 - 'style' => [
1304 - (object)[
1305 - 'depends' => [
1306 - (object)['key'=>'showImage','condition'=>'==','value'=>true],
1307 - ],
1308 - 'selector'=>'{{ULTP}} .ultp-block-content-overlay:hover'
1309 - ],
1310 - ],
1311 - ],
1312 - 'imgOverlay' => [
1313 - 'type' => 'boolean',
1314 - 'default' => true,
1315 - ],
1316 - 'imgOverlayType' => [
1317 - 'type' => 'string',
1318 - 'default' => 'flat',
1319 - 'style' => [
1320 - (object)[
1321 - 'depends' => [
1322 - (object)['key'=>'imgOverlay','condition'=>'==','value'=>true],
1323 - ]
1324 - ],
1325 - ]
1326 - ],
1327 - 'overlayColor' => [
1328 - 'type' => 'object',
1329 - 'default' => (object)['openColor' => 1, 'type' => 'color', 'color' => '#0e1523'],
1330 - 'style' => [
1331 - (object)[
1332 - 'depends' => [
1333 - (object)['key'=>'imgOverlayType','condition'=>'==','value'=>'custom'],
1334 - ],
1335 - 'selector'=>'{{ULTP}} .ultp-block-image-custom > a::before'
1336 - ],
1337 - ],
191 + /*
192 + ============================
193 + Dynamic Content
194 + ============================*/
195 + 'dcEnabled' => false,
196 + 'dcFields' => array(),
197 + 'dcSize' => 8,
198 + );
199 + }
1338 200
1339 - ],
1340 - 'imgOpacity' => [
1341 - 'type' => 'string',
1342 - 'default' => .7,
1343 - 'style' => [
1344 - (object)[
1345 - 'depends' => [
1346 - (object)['key'=>'imgOverlayType','condition'=>'==','value'=>'custom'],
1347 - ],
1348 - 'selector'=>'{{ULTP}} .ultp-block-image-custom > a::before { opacity: {{imgOpacity}}; }'
1349 - ],
1350 - ],
1351 - ],
201 + public function register() {
202 + register_block_type(
203 + 'ultimate-post/post-grid-2',
204 + array(
205 + 'editor_script' => 'ultp-blocks-editor-script',
206 + 'editor_style' => 'ultp-blocks-editor-css',
207 + 'render_callback' => array( $this, 'content' ),
208 + )
209 + );
210 + }
1352 211
1353 - //--------------------------
1354 - // Read more Setting/Style
1355 - //--------------------------
1356 - 'readMoreText' => [
1357 - 'type' => 'string',
1358 - 'default' => ''
1359 - ],
1360 - 'readMoreIcon' => [
1361 - 'type' => 'string',
1362 - 'default' => 'rightArrowLg',
1363 - ],
1364 - 'readMoreTypo' => [
1365 - 'type' => 'object',
1366 - 'default' => (object)['openTypography' => 1, 'size' => (object)['lg' =>12, 'unit' =>'px'], 'height' => (object)['lg' =>'', 'unit' =>'px'], 'spacing' => (object)['lg' =>1, 'unit' =>'px'], 'transform' => 'uppercase', 'weight' => '400', 'decoration' => 'none','family'=>'' ],
1367 - 'style' => [
1368 - (object)[
1369 - 'depends' => [
1370 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1371 - ],
1372 - 'selector'=>'{{ULTP}} .ultp-block-readmore a'
1373 - ],
1374 - ],
1375 - ],
1376 - 'readMoreIconSize' => [
1377 - 'type' => 'object',
1378 - 'default' => (object)['lg' =>'', 'unit' =>'px'],
1379 - 'style' => [
1380 - (object)[
1381 - 'depends' => [
1382 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1383 - ],
1384 - 'selector' => '{{ULTP}} .ultp-block-readmore svg{ width:{{readMoreIconSize}}; }'
1385 - ],
1386 - ]
1387 - ],
1388 - 'readMoreColor' => [
1389 - 'type' => 'string',
1390 - 'default' => '#fff',
1391 - 'style' => [
1392 - (object)[
1393 - 'depends' => [
1394 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1395 - ],
1396 - 'selector'=>'{{ULTP}} .ultp-block-readmore a { color:{{readMoreColor}}; } {{ULTP}} .ultp-block-readmore a svg { fill:{{readMoreColor}}; }'
1397 - ],
1398 - ],
1399 - ],
1400 - 'readMoreBgColor' => [
1401 - 'type' => 'object',
1402 - 'default' => (object)['openColor' => 0,'type' => 'color', 'color' => '#000'],
1403 - 'style' => [
1404 - (object)[
1405 - 'depends' => [
1406 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1407 - ],
1408 - 'selector'=>'{{ULTP}} .ultp-block-readmore a'
1409 - ],
1410 - ],
1411 - ],
1412 - 'readMoreBorder' => [
1413 - 'type' => 'object',
1414 - 'default' => (object)['openBorder'=>0, 'width' => (object)[ 'top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid' ],
1415 - 'style' => [
1416 - (object)[
1417 - 'depends' => [
1418 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1419 - ],
1420 - 'selector'=>'{{ULTP}} .ultp-block-readmore a'
1421 - ],
1422 - ],
1423 - ],
1424 - 'readMoreRadius' => [
1425 - 'type' => 'object',
1426 - 'default' => (object)['lg' =>'', 'unit' =>'px'],
1427 - 'style' => [
1428 - (object)[
1429 - 'depends' => [
1430 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1431 - ],
1432 - 'selector'=>'{{ULTP}} .ultp-block-readmore a { border-radius:{{readMoreRadius}}; }'
1433 - ],
1434 - ],
1435 - ],
1436 - 'readMoreHoverColor' => [
1437 - 'type' => 'string',
1438 - 'default' => '#fff',
1439 - 'style' => [
1440 - (object)[
1441 - 'depends' => [
1442 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1443 - ],
1444 - 'selector'=>'{{ULTP}} .ultp-block-readmore a:hover { color:{{readMoreHoverColor}}; } {{ULTP}} .ultp-block-readmore a:hover svg { fill:{{readMoreHoverColor}}; }'
1445 - ],
1446 - ],
1447 - ],
1448 - 'readMoreBgHoverColor' => [
1449 - 'type' => 'object',
1450 - 'default' => (object)['openColor' => 0, 'type' => 'color', 'color' => '#1740f5'],
1451 - 'style' => [
1452 - (object)[
1453 - 'depends' => [
1454 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1455 - ],
1456 - 'selector'=>'{{ULTP}} .ultp-block-readmore a:hover'
1457 - ],
1458 - ],
1459 - ],
1460 - 'readMoreHoverBorder' => [
1461 - 'type' => 'object',
1462 - 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
1463 - 'style' => [
1464 - (object)[
1465 - 'depends' => [
1466 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1467 - ],
1468 - 'selector'=>'{{ULTP}} .ultp-block-readmore a:hover'
1469 - ],
1470 - ],
1471 - ],
1472 - 'readMoreHoverRadius' => [
1473 - 'type' => 'object',
1474 - 'default' => (object)['lg' =>'', 'unit' =>'px'],
1475 - 'style' => [
1476 - (object)[
1477 - 'depends' => [
1478 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1479 - ],
1480 - 'selector'=>'{{ULTP}} .ultp-block-readmore a:hover { border-radius:{{readMoreHoverRadius}}; }'
1481 - ],
1482 - ],
1483 - ],
1484 - 'readMoreSacing' => [
1485 - 'type' => 'object',
1486 - 'default' => (object)['lg' =>(object)['top' => 15,'bottom' => '','left' => '','right' => '', 'unit' =>'px']],
1487 - 'style' => [
1488 - (object)[
1489 - 'depends' => [
1490 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1491 - ],
1492 - 'selector'=>'{{ULTP}} .ultp-block-readmore { margin:{{readMoreSacing}}; }'
1493 - ],
1494 - ],
1495 - ],
1496 - 'readMorePadding' => [
1497 - 'type' => 'object',
1498 - 'default' => (object)['lg' =>(object)['top' => '','bottom' => '','left' => '','right' => '', 'unit' =>'px']],
1499 - 'style' => [
1500 - (object)[
1501 - 'depends' => [
1502 - (object)['key'=>'readMore','condition'=>'==','value'=>true],
1503 - ],
1504 - 'selector'=>'{{ULTP}} .ultp-block-readmore a { padding:{{readMorePadding}}; }'
1505 - ],
1506 - ],
1507 - ],
212 + public function content( $attr, $noAjax ) {
213 + $attr = wp_parse_args( $attr, $this->get_attributes() );
214 + global $unique_ID;
1508 215
1509 - //--------------------------
1510 - // Filter Setting/Style
1511 - //--------------------------
1512 - 'filterType' => [
1513 - 'type' => 'string',
1514 - 'default' => 'category'
1515 - ],
1516 - 'filterText' => [
1517 - 'type' => 'string',
1518 - 'default' => 'all'
1519 - ],
1520 - 'filterCat' => [
1521 - 'type' => 'string',
1522 - 'default' => '[]',
1523 - 'style' => [
1524 - (object)[
1525 - 'depends' => [(object)['key' => 'filterType','condition' => '==','value' => 'category']]
1526 - ],
1527 - ],
1528 - ],
1529 - 'filterTag' => [
1530 - 'type' => 'string',
1531 - 'default' => '[]',
1532 - 'style' => [
1533 - (object)[
1534 - 'depends' => [(object)['key' => 'filterType','condition' => '==','value' => 'post_tag']]
1535 - ],
1536 - ],
1537 - ],
1538 - 'fliterTypo' => [
1539 - 'type' => 'object',
1540 - 'default' => (object)['openTypography' => 1,'size' => (object)['lg' =>14, 'unit' =>'px'],'height' => (object)['lg' =>18, 'unit' =>'px'], 'decoration' => 'none','family'=>'','weight'=>500],
1541 - 'style' => [
1542 - (object)[
1543 - 'depends' => [
1544 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1545 - ],
1546 - 'selector'=>'{{ULTP}} .ultp-filter-navigation .ultp-filter-wrap ul li a'
1547 - ],
1548 - ],
1549 - ],
1550 - 'filterColor' => [
1551 - 'type' => 'string',
1552 - 'default' => '#0e1523',
1553 - 'style' => [
1554 - (object)[
1555 - 'depends' => [
1556 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1557 - ],
1558 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li a { color:{{filterColor}}; }'
1559 - ],
1560 - ],
1561 - ],
1562 - 'filterHoverColor' => [
1563 - 'type' => 'string',
1564 - 'default' => '#828282',
1565 - 'style' => [
1566 - (object)[
1567 - 'depends' => [
1568 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1569 - ],
1570 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li a:hover, {{ULTP}} .ultp-filter-wrap ul li a.filter-active { color:{{filterHoverColor}}; }'
1571 - ],
1572 - ],
1573 - ],
1574 - 'filterBgColor' => [
1575 - 'type' => 'string',
1576 - 'style' => [
1577 - (object)[
1578 - 'depends' => [
1579 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1580 - ],
1581 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.filter-item > a { background:{{filterBgColor}}; }'
1582 - ],
1583 - ],
1584 - ],
1585 - 'filterHoverBgColor' => [
1586 - 'type' => 'string',
1587 - 'style' => [
1588 - (object)[
1589 - 'depends' => [
1590 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1591 - ],
1592 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.filter-item > a:hover, {{ULTP}} .ultp-filter-wrap ul li.filter-item > a.filter-active { background:{{filterHoverBgColor}}; }'
1593 - ],
1594 - ],
1595 - ],
1596 - 'filterBorder' => [
1597 - 'type' => 'object',
1598 - 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
1599 - 'style' => [
1600 - (object)[
1601 - 'depends' => [
1602 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1603 - ],
1604 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.filter-item > a'
1605 - ],
1606 - ],
1607 - ],
1608 - 'filterHoverBorder' => [
1609 - 'type' => 'object',
1610 - 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
1611 - 'style' => [
1612 - (object)[
1613 - 'depends' => [
1614 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1615 - ],
1616 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.filter-item > a:hover'
1617 - ],
1618 - ],
1619 - ],
1620 - 'filterRadius' => [
1621 - 'type' => 'object',
1622 - 'default' => (object)['lg' =>'', 'unit' =>'px'],
1623 - 'style' => [
1624 - (object)[
1625 - 'depends' => [
1626 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1627 - ],
1628 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.filter-item > a { border-radius:{{filterRadius}}; }'
1629 - ],
1630 - ],
1631 - ],
1632 - 'fliterSpacing' => [
1633 - 'type' => 'object',
1634 - 'default' => (object)['lg' =>(object)['top' => '','bottom' => '', 'right' => '', 'left' => '20', 'unit' =>'px']],
1635 - 'style' => [
1636 - (object)[
1637 - 'depends' => [
1638 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1639 - ],
1640 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li { margin:{{fliterSpacing}}; }'
1641 - ],
1642 - ],
1643 - ],
1644 - 'fliterPadding' => [
1645 - 'type' => 'object',
1646 - 'default' => (object)['lg' =>(object)['top' => '','bottom' => '', 'unit' =>'px']],
1647 - 'style' => [
1648 - (object)[
1649 - 'depends' => [
1650 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1651 - ],
1652 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.filter-item > a { padding:{{fliterPadding}}; }'
1653 - ],
1654 - ],
1655 - ],
1656 - 'filterDropdownColor' => [
1657 - 'type' => 'string',
1658 - 'default' => '#0e1523',
1659 - 'style' => [
1660 - (object)[
1661 - 'depends' => [
1662 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1663 - ],
1664 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.flexMenu-viewMore .flexMenu-popup li a { color:{{filterDropdownColor}}; }'
1665 - ],
1666 - ],
1667 - ],
1668 - 'filterDropdownHoverColor' => [
1669 - 'type' => 'string',
1670 - 'default' => '#1740f5',
1671 - 'style' => [
1672 - (object)[
1673 - 'depends' => [
1674 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1675 - ],
1676 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.flexMenu-viewMore .flexMenu-popup li a:hover { color:{{filterDropdownHoverColor}}; }'
1677 - ],
1678 - ],
1679 - ],
1680 - 'filterDropdownBg' => [
1681 - 'type' => 'string',
1682 - 'default' => '#fff',
1683 - 'style' => [
1684 - (object)[
1685 - 'depends' => [
1686 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1687 - ],
1688 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.flexMenu-viewMore .flexMenu-popup { background:{{filterDropdownBg}}; }'
1689 - ],
1690 - ],
1691 - ],
1692 - 'filterDropdownRadius' => [
1693 - 'type' => 'object',
1694 - 'default' => (object)['lg'=>'0'],
1695 - 'style' => [
1696 - (object)[
1697 - 'depends' => [
1698 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1699 - ],
1700 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.flexMenu-viewMore .flexMenu-popup { border-radius:{{filterDropdownRadius}}; }'
1701 - ],
1702 - ],
1703 - ],
1704 - 'filterDropdownPadding' => [
1705 - 'type' => 'object',
1706 - 'default' => (object)['lg' =>(object)['top' => '15','bottom' => '15','left' => '20','right' => '20', 'unit' =>'px']],
1707 - 'style' => [
1708 - (object)[
1709 - 'depends' => [
1710 - (object)['key'=>'filterShow','condition'=>'==','value'=>true],
1711 - ],
1712 - 'selector'=>'{{ULTP}} .ultp-filter-wrap ul li.flexMenu-viewMore .flexMenu-popup { padding:{{filterDropdownPadding}}; }'
1713 - ],
1714 - ],
1715 - ],
216 + if ( ! $noAjax ) {
217 + $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );
218 + $attr['paged'] = $paged ? $paged : 1;
219 + }
220 + if ( $attr['queryUnique'] && isset( $attr['savedQueryUnique'] ) ) {
221 + $unique_ID = $attr['savedQueryUnique'];
222 + }
1716 223
1717 - //--------------------------
1718 - // Pagination Setting/Style
1719 - //--------------------------
1720 - 'paginationType' => [
1721 - 'type' => 'string',
1722 - 'default' => 'loadMore',
1723 - ],
1724 - 'loadMoreText' => [
1725 - 'type' => 'string',
1726 - 'default' => 'Load More',
1727 - 'style' => [
1728 - (object)[
1729 - 'depends' => [
1730 - (object)['key'=>'paginationType','condition'=>'==','value'=>'loadMore'],
1731 - ],
1732 - ],
1733 - ],
1734 - ],
1735 - 'paginationNav' => [
1736 - 'type' => 'string',
1737 - 'default' => 'textArrow',
1738 - 'style' => [
1739 - (object)[
1740 - 'depends' => [
1741 - (object)['key'=>'paginationType','condition'=>'==','value'=>'pagination'],
1742 - ],
1743 - ],
1744 - ],
1745 - ],
1746 - 'paginationAjax' => [
1747 - 'type' => 'boolean',
1748 - 'default' => true,
1749 - 'style' => [
1750 - (object)[
1751 - 'depends' => [
1752 - (object)['key'=>'paginationType','condition'=>'==','value'=>'pagination'],
1753 - ],
1754 - ],
1755 - ],
1756 - ],
1757 - 'navPosition' => [
1758 - 'type' => 'string',
1759 - 'default' => 'topRight',
1760 - 'style' => [
1761 - (object)[
1762 - 'depends' => [
1763 - (object)['key'=>'paginationType','condition'=>'==','value'=>'navigation'],
1764 - ],
1765 - ],
1766 - ],
1767 - ],
1768 - 'pagiAlign' => [
1769 - 'type' => 'object',
1770 - 'default' => (object)['lg' =>'left'],
1771 - 'style' => [
1772 - (object)[
1773 - 'depends' => [
1774 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1775 - ],
1776 - 'selector'=>'{{ULTP}} .ultp-loadmore, {{ULTP}} .ultp-next-prev-wrap ul, {{ULTP}} .ultp-pagination { text-align:{{pagiAlign}}; }'
1777 - ],
1778 - ],
1779 - ],
1780 - 'pagiTypo' => [
1781 - 'type' => 'object',
1782 - 'default' => (object)['openTypography' => 1,'size' => (object)['lg' =>14, 'unit' =>'px'],'height' => (object)['lg' =>20, 'unit' =>'px'], 'decoration' => 'none','family'=>''],
1783 - 'style' => [
1784 - (object)[
1785 - 'depends' => [
1786 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1787 - ],
1788 - 'selector'=>'{{ULTP}} .ultp-pagination-wrap .ultp-pagination li a, {{ULTP}} .ultp-loadmore .ultp-loadmore-action'
1789 - ],
1790 - ],
224 + $block_name = 'post-grid-2';
225 + $wraper_before = $wraper_after = $post_loop = '';
226 + // Current Post Id For Pagiantion
227 + $curr_post_id = '';
228 + if ( is_single() ) {
229 + $curr_post_id = get_the_ID();
230 + }
231 + $attr['queryNumber'] = ultimate_post()->get_post_number( 6, $attr['queryNumber'], $attr['queryNumPosts'] );
232 + $recent_posts = new \WP_Query( ultimate_post()->get_query( $attr ) );
233 + $pageNum = ultimate_post()->get_page_number( $attr, $recent_posts->found_posts );
234 + // Dummy Img Url
235 + $dummy_url = ULTP_URL . 'assets/img/ultp-fallback-img.png';
1791 236
1792 - ],
1793 - 'pagiArrowSize' => [
1794 - 'type' => 'object',
1795 - 'default' => (object)['lg'=>'14'],
1796 - 'style' => [
1797 - (object)[
1798 - 'depends' => [
1799 - (object)['key'=>'paginationType','condition'=>'==','value'=>'navigation'],
1800 - ],
1801 - 'selector'=>'{{ULTP}} .ultp-next-prev-wrap ul li a svg { width:{{pagiArrowSize}}px; }'
1802 - ],
1803 - ],
237 + // Loadmore and Unique content
238 + if ( $attr['queryUnique'] && isset( $attr['loadMoreQueryUnique'] ) && $attr['paginationShow'] && ( $attr['paginationType'] == 'loadMore' ) ) {
239 + $unique_ID = $attr['loadMoreQueryUnique'];
240 + $current_unique_posts = $attr['ultp_current_unique_posts'];
241 + }
1804 242
1805 - ],
1806 - 'pagiColor' => [
1807 - 'type' => 'string',
1808 - 'default' => '#fff',
1809 - 'style' => [
1810 - (object)[
1811 - 'depends' => [
1812 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1813 - ],
1814 - 'selector'=>'{{ULTP}} .ultp-pagination li a, {{ULTP}} .ultp-next-prev-wrap ul li a, {{ULTP}} .ultp-loadmore .ultp-loadmore-action { color:{{pagiColor}}; } {{ULTP}} .ultp-next-prev-wrap ul li a svg { fill:{{pagiColor}}; } {{ULTP}} .ultp-pagination li a svg, {{ULTP}} .ultp-loadmore .ultp-loadmore-action svg { fill:{{pagiColor}}; }'
1815 - ],
1816 - ],
1817 - ],
243 + $attr['className'] = isset( $attr['className'] ) && $attr['className'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['className'] ) : '';
244 + $attr['align'] = isset( $attr['align'] ) && $attr['align'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['align'] ) : '';
245 + $attr['advanceId'] = isset( $attr['advanceId'] ) ? sanitize_html_class( $attr['advanceId'] ) : '';
246 + $attr['blockId'] = isset( $attr['blockId'] ) ? sanitize_html_class( $attr['blockId'] ) : '';
247 + $attr['contentTag'] = in_array( $attr['contentTag'], ultimate_post()->ultp_allowed_block_tags() ) ? $attr['contentTag'] : 'div';
248 + $attr['imgAnimation'] = sanitize_html_class( $attr['imgAnimation'] );
249 + $attr['imgOverlayType'] = sanitize_html_class( $attr['imgOverlayType'] );
250 + $attr['popupAutoPlay'] = $attr['popupAutoPlay'] == true;
251 + $attr['readMoreText'] = wp_kses( $attr['readMoreText'], ultimate_post()->ultp_allowed_html_tags() );
252 + $attr['titleAnimation'] = sanitize_html_class( $attr['titleAnimation'] );
253 + $attr['overlayContentPosition'] = sanitize_html_class( $attr['overlayContentPosition'] );
1818 254
1819 - 'pagiBgColor' => [
1820 - 'type' => 'object',
1821 - 'default' => (object)['openColor' => 1, 'type' => 'color', 'color' => '#0e1523'],
1822 - 'style' => [
1823 - (object)[
1824 - 'depends' => [
1825 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1826 - ],
1827 - 'selector'=>'{{ULTP}} .ultp-pagination li a, {{ULTP}} .ultp-next-prev-wrap ul li a, {{ULTP}} .ultp-loadmore .ultp-loadmore-action'
1828 - ],
1829 - ],
1830 - ],
1831 - 'pagiBorder' => [
1832 - 'type' => 'object',
1833 - 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
1834 - 'style' => [
1835 - (object)[
1836 - 'depends' => [
1837 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1838 - ],
1839 - 'selector'=>'{{ULTP}} .ultp-pagination li a, {{ULTP}} .ultp-next-prev-wrap ul li a, {{ULTP}} .ultp-loadmore-action'
1840 - ],
1841 - ],
1842 - ],
1843 - 'pagiShadow' => [
1844 - 'type' => 'object',
1845 - 'default' => (object)['openShadow' => 0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4'],
1846 - 'style' => [
1847 - (object)[
1848 - 'depends' => [
1849 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1850 - ],
1851 - 'selector'=>'{{ULTP}} .ultp-pagination li a, {{ULTP}} .ultp-next-prev-wrap ul li a, {{ULTP}} .ultp-loadmore-action'
1852 - ],
1853 - ],
1854 - ],
1855 - 'pagiRadius' => [
1856 - 'type' => 'object',
1857 - 'default' => (object)['lg' =>(object)['top' => '2','bottom' => '2','left' => '2','right' => '2', 'unit' =>'px']],
1858 - 'style' => [
1859 - (object)[
1860 - 'depends' => [
1861 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1862 - ],
1863 - 'selector'=>'{{ULTP}} .ultp-pagination li a, {{ULTP}} .ultp-next-prev-wrap ul li a, {{ULTP}} .ultp-loadmore-action { border-radius:{{pagiRadius}}; }'
1864 - ],
1865 - ],
1866 - ],
1867 - 'pagiHoverColor' => [
1868 - 'type' => 'string',
1869 - 'default' => '#fff',
1870 - 'style' => [
1871 - (object)[
1872 - 'depends' => [
1873 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1874 - ],
1875 - 'selector'=>'{{ULTP}} .ultp-pagination li.pagination-active a, {{ULTP}} .ultp-next-prev-wrap ul li a:hover, {{ULTP}} .ultp-loadmore .ultp-loadmore-action:hover { color:{{pagiHoverColor}}; } {{ULTP}} .ultp-pagination li a:hover svg, {{ULTP}} .ultp-loadmore .ultp-loadmore-action:hover svg { fill:{{pagiHoverColor}}; } {{ULTP}} .ultp-next-prev-wrap ul li a:hover svg { fill:{{pagiHoverColor}}; } @media (min-width: 768px) { {{ULTP}} .ultp-pagination li a:hover { color:{{pagiHoverColor}};}}'
1876 - ],
1877 - ],
1878 - ],
1879 - 'pagiHoverbg' => [
1880 - 'type' => 'object',
1881 - 'default' => (object)['openColor' => 1, 'type' => 'color', 'color' => '#1740f5', 'replace'=>1],
1882 - 'style' => [
1883 - (object)[
1884 - 'depends' => [
1885 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1886 - ],
1887 - 'selector'=>'{{ULTP}} .ultp-pagination li.pagination-active a, {{ULTP}} .ultp-next-prev-wrap ul li a:hover, {{ULTP}} .ultp-loadmore .ultp-loadmore-action:hover { {{pagiHoverbg}} } @media (min-width: 768px) { {{ULTP}} .ultp-pagination li a:hover { {{pagiHoverbg}} }}'
1888 - ],
1889 - ],
1890 - ],
1891 - 'pagiHoverBorder' => [
1892 - 'type' => 'object',
1893 - 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
1894 - 'style' => [
1895 - (object)[
1896 - 'depends' => [
1897 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1898 - ],
1899 - 'selector'=>'{{ULTP}} .ultp-pagination li a:hover, {{ULTP}} .ultp-pagination li.pagination-active a, {{ULTP}} .ultp-next-prev-wrap ul li a:hover, {{ULTP}} .ultp-loadmore-action:hover'
1900 - ],
1901 - ],
1902 - ],
1903 - 'pagiHoverShadow' => [
1904 - 'type' => 'object',
1905 - 'default' => (object)['openShadow' => 0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4'],
1906 - 'style' => [
1907 - (object)[
1908 - 'depends' => [
1909 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1910 - ],
1911 - 'selector'=>'{{ULTP}} .ultp-pagination li a:hover, {{ULTP}} .ultp-pagination li.pagination-active a, {{ULTP}} .ultp-next-prev-wrap ul li a:hover, {{ULTP}} .ultp-loadmore-action:hover'
1912 - ],
1913 - ],
1914 - ],
1915 - 'pagiHoverRadius' => [
1916 - 'type' => 'object',
1917 - 'default' => (object)['lg' =>(object)['top' => '2','bottom' => '2','left' => '2','right' => '2', 'unit' =>'px']],
1918 - 'style' => [
1919 - (object)[
1920 - 'depends' => [
1921 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1922 - ],
1923 - 'selector'=>'{{ULTP}} .ultp-pagination li a:hover, {{ULTP}} .ultp-next-prev-wrap ul li a:hover, {{ULTP}} .ultp-loadmore-action:hover { border-radius:{{pagiHoverRadius}}; }'
1924 - ],
1925 - ],
1926 - ],
1927 - 'pagiPadding' => [
1928 - 'type' => 'object',
1929 - 'default' => (object)['lg' =>(object)['top' => '8','bottom' => '8','left' => '14','right' => '14', 'unit' =>'px']],
1930 - 'style' => [
1931 - (object)[
1932 - 'depends' => [
1933 - (object)['key'=>'paginationShow','condition'=>'==','value'=>true],
1934 - ],
1935 - 'selector'=>'{{ULTP}} .ultp-pagination li a, {{ULTP}} .ultp-next-prev-wrap ul li a, {{ULTP}} .ultp-loadmore-action { padding:{{pagiPadding}}; }'
1936 - ],
1937 - ],
1938 - ],
1939 - 'navMargin' => [
1940 - 'type' => 'object',
1941 - 'default' => (object)['lg' =>(object)['top' => '0', 'right' => '0', 'bottom' => '0', 'left' => '0', 'unit' =>'px']],
1942 - 'style' => [
1943 - (object)[
1944 - 'depends' => [
1945 - (object)['key'=>'paginationType','condition'=>'==','value'=>'navigation'],
1946 - ],
1947 - 'selector'=>'{{ULTP}} .ultp-next-prev-wrap ul { margin:{{navMargin}}; }'
1948 - ],
1949 - ],
1950 - ],
1951 - 'pagiMargin' => [
1952 - 'type' => 'object',
1953 - 'default' => (object)['lg' =>(object)['top' => '30', 'right' => '0', 'bottom' => '0', 'left' => '0', 'unit' =>'px']],
1954 - 'style' => [
1955 - (object)[
1956 - 'depends' => [
1957 - (object)['key'=>'paginationType','condition'=>'!=','value'=>'navigation'],
1958 - ],
1959 - 'selector'=>'{{ULTP}} .ultp-pagination, {{ULTP}} .ultp-loadmore { margin:{{pagiMargin}}; }'
1960 - ],
1961 - ],
1962 - ],
255 + $iscroll = '';
256 + $wrap_data = '';
257 + if ( $attr['infiniteScroll'] ) {
258 + $iscroll = 'ultp-iscroll-active';
259 + include ULTP_PATH . 'blocks/template/infinite_scroll_data.php';
260 + }
1963 261
262 + if ( $recent_posts->have_posts() ) {
263 + // Pagination Block Html
264 + include ULTP_PATH . 'blocks/template/pagination_block.php';
1964 265
266 + $wraper_before .= '<div ' . ( $attr['advanceId'] ? 'id="' . $attr['advanceId'] . '" ' : '' ) . ' class="ultp-post-grid-block wp-block-ultimate-post-' . $block_name . ' ultp-block-' . $attr['blockId'] . '' . ( $attr['align'] ? ' align' . $attr['align'] : '' ) . '' . ( $attr['className'] ? ' ' . $attr['className'] : '' ) . ' ' . $iscroll . '">';
267 + $wraper_before .= '<div class="ultp-block-wrapper" ' . $wrap_data . '>';
1965 268
1966 - //--------------------------
1967 - // Wrapper Style
1968 - //--------------------------
1969 - 'loadingColor' => [
1970 - 'type' => 'string',
1971 - 'default' => '#000',
1972 - 'style' => [
1973 - (object)[
1974 - 'selector'=>'{{ULTP}} .ultp-loading .ultp-loading-blocks div { --loading-block-color: {{loadingColor}}; }'
1975 - ],
1976 - ],
1977 - ],
1978 - 'wrapBg' => [
1979 - 'type' => 'object',
1980 - 'default' => (object)['openColor' => 0, 'type' => 'color', 'color' => '#f5f5f5'],
1981 - 'style' => [
1982 - (object)[
1983 - 'selector'=>'{{ULTP}} .ultp-block-wrapper'
1984 - ],
1985 - ],
1986 - ],
1987 - 'wrapBorder' => [
1988 - 'type' => 'object',
1989 - 'default' => (object)['openBorder'=>0, 'width' =>(object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
1990 - 'style' => [
1991 - (object)[
1992 - 'selector'=>'{{ULTP}} .ultp-block-wrapper'
1993 - ],
1994 - ],
1995 - ],
1996 - 'wrapShadow' => [
1997 - 'type' => 'object',
1998 - 'default' => (object)['openShadow' => 0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4'],
1999 - 'style' => [
2000 - (object)[
2001 - 'selector'=>'{{ULTP}} .ultp-block-wrapper'
2002 - ],
2003 - ],
2004 - ],
2005 - 'wrapRadius' => [
2006 - 'type' => 'object',
2007 - 'default' => (object)['lg' =>'', 'unit' =>'px'],
2008 - 'style' => [
2009 - (object)[
2010 - 'selector'=>'{{ULTP}} .ultp-block-wrapper { border-radius:{{wrapRadius}}; }'
2011 - ],
2012 - ],
2013 - ],
2014 - 'wrapHoverBackground' => [
2015 - 'type' => 'object',
2016 - 'default' => (object)['openColor' => 0, 'type' => 'color', 'color' => '#1740f5'],
2017 - 'style' => [
2018 - (object)[
2019 - 'selector'=>'{{ULTP}} .ultp-block-wrapper:hover'
2020 - ],
2021 - ],
2022 - ],
2023 - 'wrapHoverBorder' => [
2024 - 'type' => 'object',
2025 - 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
2026 - 'style' => [
2027 - (object)[
2028 - 'selector'=>'{{ULTP}} .ultp-block-wrapper:hover'
2029 - ],
2030 - ],
2031 - ],
2032 - 'wrapHoverRadius' => [
2033 - 'type' => 'object',
2034 - 'default' => (object)['lg' =>'', 'unit' =>'px'],
2035 - 'style' => [
2036 - (object)[
2037 - 'selector'=>'{{ULTP}} .ultp-block-wrapper:hover { border-radius:{{wrapHoverRadius}}; }'
2038 - ],
2039 - ],
2040 - ],
2041 - 'wrapHoverShadow' => [
2042 - 'type' => 'object',
2043 - 'default' => (object)['openShadow' => 0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4'],
2044 - 'style' => [
2045 - (object)[
2046 - 'selector'=>'{{ULTP}} .ultp-block-wrapper:hover'
2047 - ],
2048 - ],
2049 - ],
2050 - 'wrapMargin' => [
2051 - 'type' => 'object',
2052 - 'default' => (object)['lg' =>(object)['top' => '','bottom' => '', 'unit' =>'px']],
2053 - 'style' => [
2054 - (object)[
2055 - 'selector'=>'{{ULTP}} .ultp-block-wrapper { margin:{{wrapMargin}}; }'
2056 - ],
2057 - ],
2058 - ],
2059 - 'wrapOuterPadding' => [
2060 - 'type' => 'object',
2061 - 'default' => (object)['lg' =>(object)['top' => '','bottom' => '','left' => '', 'right' => '', 'unit' =>'px']],
2062 - 'style' => [
2063 - (object)[
2064 - 'selector'=>'{{ULTP}} .ultp-block-wrapper { padding:{{wrapOuterPadding}}; }'
2065 - ],
2066 - ],
2067 - ],
2068 - 'advanceId' => [
2069 - 'type' => 'string',
2070 - 'default' => '',
2071 - ],
2072 - 'advanceZindex' => [
2073 - 'type' => 'number',
2074 - 'default' => '',
2075 - 'style' => [
2076 - (object)[
2077 - 'selector' => '{{ULTP}} {z-index:{{advanceZindex}};}'
2078 - ],
2079 - ],
2080 - ],
2081 - 'hideExtraLarge' => [
2082 - 'type' => 'boolean',
2083 - 'default' => false,
2084 - 'style' => [
2085 - (object)[
2086 - 'selector' => '{{ULTP}} {display:none;}'
2087 - ],
2088 - ],
2089 - ],
2090 - 'hideDesktop' => [
2091 - 'type' => 'boolean',
2092 - 'default' => false,
2093 - 'style' => [
2094 - (object)[
2095 - 'selector' => '{{ULTP}} {display:none;}'
2096 - ],
2097 - ],
2098 - ],
2099 - 'hideTablet' => [
2100 - 'type' => 'boolean',
2101 - 'default' => false,
2102 - 'style' => [
2103 - (object)[
2104 - 'selector' => '{{ULTP}} {display:none;}'
2105 - ],
2106 - ],
2107 - ],
2108 - 'hideMobile' => [
2109 - 'type' => 'boolean',
2110 - 'default' => false,
2111 - 'style' => [
2112 - (object)[
2113 - 'selector' => '{{ULTP}} {display:none;}'
2114 - ],
2115 - ],
2116 - ],
2117 - 'advanceCss' => [
2118 - 'type' => 'string',
2119 - 'default' => '',
2120 - 'style' => [(object)['selector' => '']],
2121 - ]
2122 - );
2123 -
2124 - if( $default ){
2125 - $temp = array();
2126 - foreach ($attributes as $key => $value) {
2127 - if( isset($value['default']) ){
2128 - $temp[$key] = $value['default'];
2129 - }
2130 - }
2131 - return $temp;
2132 - }else{
2133 - return $attributes;
2134 - }
2135 - }
269 + // Loading
270 + $wraper_before .= ultimate_post()->postx_loading();
2136 271
2137 - public function register() {
2138 - register_block_type( 'ultimate-post/post-grid-2',
2139 - array(
2140 - 'attributes' => $this->get_attributes(),
2141 - 'description' => __( 'Post grid with gradient image overlay style.' ),
2142 - 'keywords' => [ __( 'grid' ), __( 'post' ), __( 'article' ), __('listing') ],
2143 - 'render_callback' => array($this, 'content')
2144 - ));
2145 - }
272 + if ( $attr['headingShow'] || $attr['filterShow'] || $attr['paginationShow'] ) {
273 + $wraper_before .= '<div class="ultp-heading-filter">';
274 + $wraper_before .= '<div class="ultp-heading-filter-in">';
2146 275
2147 - public function content($attr, $noAjax) {
276 + // Heading
277 + include ULTP_PATH . 'blocks/template/heading.php';
2148 278
2149 - if(!$noAjax){
2150 - $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
2151 - $attr['paged'] = $paged;
2152 - }
279 + if ( $attr['filterShow'] || $attr['paginationShow'] ) {
280 + $wraper_before .= '<div class="ultp-filter-navigation">';
2153 281
2154 - $block_name = 'post-grid-2';
2155 - $page_post_id = get_the_ID();
2156 - $wraper_before = $wraper_after = $post_loop = '';
2157 -
2158 - $recent_posts = new \WP_Query( ultimate_post()->get_query( $attr ) );
2159 - $pageNum = ultimate_post()->get_page_number($attr, $recent_posts->found_posts);
2160 -
2161 - if ($recent_posts->have_posts()) {
2162 -
2163 - $wraper_before .= '<div '.($attr['advanceId']?'id="'.$attr['advanceId'].'" ':'').' class="wp-block-ultimate-post-'.$block_name.' ultp-block-'.$attr["blockId"].''.(isset($attr["align"])? ' align' .$attr["align"]:'').''.(isset($attr["className"])?' '.$attr["className"]:'').'">';
2164 - $wraper_before .= '<div class="ultp-block-wrapper">';
282 + // Filter
283 + if ( $attr['filterShow'] && $attr['queryType'] != 'posts' && $attr['queryType'] != 'customPosts' ) {
284 + include ULTP_PATH . 'blocks/template/filter.php';
285 + }
2165 286
2166 - // Loading
2167 - $wraper_before .= ultimate_post()->loading();
287 + // Navigation
288 + if ( $attr['paginationShow'] && ( $attr['paginationType'] == 'navigation' ) && ( $attr['navPosition'] == 'topRight' ) ) {
289 + include ULTP_PATH . 'blocks/template/navigation-before.php';
290 + }
291 + $wraper_before .= '</div>';
292 + }
2168 293
2169 - if ($attr['headingShow'] || $attr['filterShow'] || $attr['paginationShow']) {
2170 - $wraper_before .= '<div class="ultp-heading-filter">';
2171 - $wraper_before .= '<div class="ultp-heading-filter-in">';
2172 -
2173 - // Heading
2174 - include ULTP_PATH.'blocks/template/heading.php';
2175 -
2176 - if ($attr['filterShow'] || $attr['paginationShow']) {
2177 - $wraper_before .= '<div class="ultp-filter-navigation">';
294 + $wraper_before .= '</div>';
295 + $wraper_before .= '</div>';
296 + }
2178 297
2179 - // Filter
2180 - if($attr['filterShow']) {
2181 - include ULTP_PATH.'blocks/template/filter.php';
2182 - }
298 + $wraper_before .= '<div class="ultp-block-items-wrap ultp-block-row">';
299 + $idx = $noAjax ? 1 : 0;
300 + while ( $recent_posts->have_posts() ) :
301 + $recent_posts->the_post();
2183 302
2184 - // Navigation
2185 - if($attr['paginationShow'] && ($attr['paginationType'] == 'navigation') && ($attr['navPosition'] == 'topRight')) {
2186 - include ULTP_PATH.'blocks/template/navigation-before.php';
2187 - }
2188 - $wraper_before .= '</div>';
2189 - }
303 + $dcContent = array_fill( 0, $attr['dcSize'], '' );
2190 304
2191 - $wraper_before .= '</div>';
2192 - $wraper_before .= '</div>';
2193 - }
2194 -
2195 - $wraper_before .= '<div class="ultp-block-items-wrap ultp-block-row">';
2196 - $idx = $noAjax ? 1 : 0;
2197 - while ( $recent_posts->have_posts() ): $recent_posts->the_post();
305 + if ( ultimate_post()->is_dc_active( $attr ) ) {
306 + $dcContent = \ULTP\DCService::get_dc_content_for_block( $attr, $dcContent );
307 + }
2198 308
2199 - include ULTP_PATH.'blocks/template/data.php';
309 + include ULTP_PATH . 'blocks/template/data.php';
2200 310
2201 - include ULTP_PATH.'blocks/template/category.php';
2202 -
2203 - $post_loop .= '<div class="ultp-block-item post-id-'.$post_id.($attr['titleAnimation'] ? ' ultp-animation-'.$attr['titleAnimation'] : '').'">';
2204 - $post_loop .= '<div class="ultp-block-content-wrap ultp-block-content-overlay">';
2205 - if( has_post_thumbnail() && $attr['showImage'] ){
2206 - $post_loop .= '<div class="ultp-block-image ultp-block-image-'.$attr['imgAnimation'].($attr["imgOverlay"] ? ' ultp-block-image-overlay ultp-block-image-'.$attr["imgOverlayType"].' ultp-block-image-'.$attr["imgOverlayType"].$idx : '' ).'">';
2207 - $post_loop .= '<a href="'.$titlelink.'" '.($attr['openInTab'] ? 'target="_blank"' : '').'>'.ultimate_post()->get_image($post_thumb_id, $attr['imgCrop'], '', $title).'</a>';
2208 - if( ($attr['catPosition'] != 'aboveTitle') && $attr['catShow'] ) {
2209 - $post_loop .= '<div class="ultp-category-img-grid">'.$category.'</div>';
2210 - }
2211 - $post_loop .= '</div>';
2212 - } else {
2213 - $post_loop .= '<div class="ultp-block-image ultp-block-empty-image"></div>';
2214 - }
2215 - $post_loop .= '<div class="ultp-block-content ultp-block-content-'.$attr['overlayContentPosition'].'">';
2216 - $post_loop .= '<div class="ultp-block-content-inner">';
2217 -
2218 - // Category
2219 - if(($attr['catPosition'] == 'aboveTitle') && $attr['catShow']) {
2220 - $post_loop .= $category;
2221 - }
311 + include ULTP_PATH . 'blocks/template/category.php';
2222 312
2223 - // Title
2224 - if ($title && $attr['titleShow'] && $attr['titlePosition'] == 1) {
2225 - include ULTP_PATH.'blocks/template/title.php';
2226 - }
2227 -
2228 - // Meta
2229 - if( $attr['metaPosition'] =='top' ) {
2230 - include ULTP_PATH.'blocks/template/meta.php';
2231 - }
2232 -
2233 - // Title
2234 - if ($title && $attr['titleShow'] && $attr['titlePosition'] == 0) {
2235 - include ULTP_PATH.'blocks/template/title.php';
2236 - }
313 + if ( $attr['queryUnique'] ) {
314 + $unique_ID[ $attr['queryUnique'] ][] = $post_id;
315 + $current_unique_posts[] = $post_id;
316 + }
2237 317
2238 - if( $attr['excerptShow'] ) {
2239 - if ( $attr['showFullExcerpt']== 0 ) {
2240 - $post_loop .= '<div class="ultp-block-excerpt">'.ultimate_post()->excerpt($post_id, $attr['excerptLimit']).'</div>';
2241 - } else {
2242 - $post_loop .= '<div class="ultp-block-excerpt">'.get_the_excerpt().'</div>';
2243 - }
2244 - }
318 + $post_loop .= '<' . $attr['contentTag'] . ' class="ultp-block-item post-id-' . $post_id . ( $attr['titleAnimation'] ? ' ultp-animation-' . $attr['titleAnimation'] : '' ) . '">';
319 + $post_loop .= '<div class="ultp-block-content-wrap ultp-block-content-overlay">';
320 + if ( ( $post_thumb_id || $attr['fallbackEnable'] ) && $attr['showImage'] ) {
321 + $post_loop .= '<div class="ultp-block-image ultp-block-image-' . $attr['imgAnimation'] . ( $attr['imgOverlay'] ? ' ultp-block-image-overlay ultp-block-image-' . $attr['imgOverlayType'] : '' ) . '">';
322 + $post_loop .= '<a href="' . $titlelink . '" ' . ( $attr['openInTab'] ? 'target="_blank"' : '' ) . '>';
323 + // Post Image Id
324 + $block_img_id = $post_thumb_id ? $post_thumb_id : ( $attr['fallbackEnable'] && isset( $attr['fallbackImg']['id'] ) ? $attr['fallbackImg']['id'] : '' );
325 + // Post Image
326 + if ( $post_thumb_id || ( $attr['fallbackEnable'] && $block_img_id ) ) {
327 + $post_loop .= ultimate_post()->get_image( $block_img_id, $attr['imgCrop'], '', $title, $attr['imgSrcset'], $attr['imgLazy'] );
328 + } else {
329 + $video = ultimate_post()->get_youtube_id( $post_video );
330 + $post_loop .= '<img src="' . ( $video ? 'https://img.youtube.com/vi/' . $video . '/0.jpg' : $dummy_url ) . '" alt="dummy-img" />';
331 + }
332 + $post_loop .= '</a>';
333 + if ( $post_video ) {
334 + $post_loop .= '<div enableVideoPopup="' . $attr['enablePopup'] . '" enableAutoPlay="' . $attr['popupAutoPlay'] . '" class="ultp-video-icon">' . ultimate_post()->get_svg_icon( 'play_line' ) . '</div>';
335 + }
336 + if ( ( $attr['catPosition'] != 'aboveTitle' ) && $attr['catShow'] ) {
337 + $post_loop .= '<div class="ultp-category-img-grid">' . $category . '</div>';
338 + }
339 + $post_loop .= '</div>';
340 + } else {
341 + if ( $post_video ) {
342 + $post_loop .= '<div enableVideoPopup="' . $attr['enablePopup'] . '" enableAutoPlay="' . $attr['popupAutoPlay'] . '" class="ultp-video-icon">' . ultimate_post()->get_svg_icon( 'play_line' ) . '</div>';
343 + }
344 + $post_loop .= '<div class="ultp-block-image ultp-block-empty-image"></div>';
345 + }
346 + $post_loop .= '<div class="ultp-block-content ultp-block-content-' . $attr['overlayContentPosition'] . '">';
347 + $post_loop .= '<div class="ultp-block-content-inner">';
2245 348
349 + $post_loop .= $dcContent[7];
2246 350
2247 - // Read More
2248 - if ($attr['readMore']) {
2249 - $post_loop .= '<div class="ultp-block-readmore"><a href="'.$titlelink.'" '.($attr['openInTab'] ? 'target="_blank"' : '').'>'.($attr['readMoreText'] ? $attr['readMoreText'] : __( "Read More", "ultimate-post" )).ultimate_post()->svg_icon($attr['readMoreIcon']).'</a></div>';
2250 - }
351 + // Category
352 + if ( ( $attr['catPosition'] == 'aboveTitle' ) && $attr['catShow'] ) {
353 + $post_loop .= $category;
354 + }
2251 355
2252 - // Meta
2253 - if( $attr['metaPosition'] =='bottom' ) {
2254 - include ULTP_PATH.'blocks/template/meta.php';
2255 - }
356 + $post_loop .= $dcContent[6];
2256 357
2257 - $post_loop .= '</div>';
2258 - $post_loop .= '</div>';
2259 - $post_loop .= '</div>';
2260 - $post_loop .= '</div>';
2261 - $idx ++;
2262 - endwhile;
2263 - if($attr['paginationShow'] && ($attr['paginationType'] == 'loadMore')) {
2264 - $wraper_after .= '<span class="ultp-loadmore-insert-before"></span>';
2265 - }
2266 - $wraper_after .= '</div>';//ultp-block-items-wrap
2267 -
2268 - // Load More
2269 - if ($attr['paginationShow'] && ($attr['paginationType'] == 'loadMore')) {
2270 - include ULTP_PATH.'blocks/template/loadmore.php';
2271 - }
358 + // Title
359 + if ( $title && $attr['titleShow'] && $attr['titlePosition'] == 1 ) {
360 + include ULTP_PATH . 'blocks/template/title.php';
361 + }
2272 362
2273 - // Navigation
2274 - if ($attr['paginationShow'] && ($attr['paginationType'] == 'navigation') && ($attr['navPosition'] != 'topRight')) {
2275 - include ULTP_PATH.'blocks/template/navigation-after.php';
2276 - }
363 + $post_loop .= $dcContent[5];
2277 364
2278 - // Pagination
2279 - if ($attr['paginationShow'] && ($attr['paginationType'] == 'pagination')) {
2280 - include ULTP_PATH.'blocks/template/pagination.php';
2281 - }
365 + // Meta
366 + if ( $attr['metaPosition'] == 'top' ) {
367 + include ULTP_PATH . 'blocks/template/meta.php';
368 + }
2282 369
2283 - $wraper_after .= '</div>';
2284 - $wraper_after .= '</div>';
370 + $post_loop .= $dcContent[4];
2285 371
2286 - wp_reset_query();
2287 - }
372 + // Title
373 + if ( $title && $attr['titleShow'] && $attr['titlePosition'] == 0 ) {
374 + include ULTP_PATH . 'blocks/template/title.php';
375 + }
2288 376
2289 - return $noAjax ? $post_loop : $wraper_before.$post_loop.$wraper_after;
2290 - }
377 + $post_loop .= $dcContent[3];
2291 378
2292 -}
379 + if ( $attr['excerptShow'] ) {
380 + $post_loop .= '<div class="ultp-block-excerpt">' . ultimate_post()->get_excerpt( $post_id, $attr['showSeoMeta'], $attr['showFullExcerpt'], $attr['excerptLimit'] ) . '</div>';
381 + }
382 +
383 + $post_loop .= $dcContent[2];
384 +
385 + // Read More
386 + if ( $attr['readMore'] ) {
387 + $post_loop .= '<div class="ultp-block-readmore"><a aria-label="' . $title . '" href="' . $titlelink . '" ' . ( $attr['openInTab'] ? 'target="_blank"' : '' ) . '>' . ( $attr['readMoreText'] ? $attr['readMoreText'] : esc_html__( 'Read More', 'ultimate-post' ) ) . ultimate_post()->get_svg_icon( $attr['readMoreIcon'] ) . '</a></div>';
388 + }
389 +
390 + $post_loop .= $dcContent[1];
391 +
392 + // Meta
393 + if ( $attr['metaPosition'] == 'bottom' ) {
394 + include ULTP_PATH . 'blocks/template/meta.php';
395 + }
396 +
397 + $post_loop .= $dcContent[0];
398 +
399 + $post_loop .= '</div>';
400 + $post_loop .= '</div>';
401 + $post_loop .= '</div>';
402 + if ( $post_video && $attr['enablePopup'] ) {
403 + include ULTP_PATH . 'blocks/template/video_popup.php';
404 + }
405 + $post_loop .= '</' . $attr['contentTag'] . '>';
406 + ++$idx;
407 + endwhile;
408 + if ( $attr['queryUnique'] ) {
409 + $post_loop .= "<span style='display: none;' class='ultp-current-unique-posts' data-ultp-unique-ids= " . wp_json_encode( $unique_ID ) . ' data-current-unique-posts= ' . wp_json_encode( $current_unique_posts ) . '> </span>';
410 + }
411 + // if ( ($attr['paginationShow'] || $attr['advPaginationEnable']) && ($attr['paginationType'] == 'loadMore')) {
412 + // $wraper_after .= '<span class="ultp-loadmore-insert-before"></span>';
413 + // }
414 + $wraper_after .= '</div>';// ultp-block-items-wrap
415 +
416 + // Load More
417 + if ( $attr['paginationShow'] && ( $attr['paginationType'] == 'loadMore' ) ) {
418 + include ULTP_PATH . 'blocks/template/loadmore.php';
419 + }
420 +
421 + // Navigation
422 + if ( $attr['paginationShow'] && ( $attr['paginationType'] == 'navigation' ) && ( $attr['navPosition'] != 'topRight' ) ) {
423 + include ULTP_PATH . 'blocks/template/navigation-after.php';
424 + }
425 +
426 + // Pagination
427 + if ( $attr['paginationShow'] && ( $attr['paginationType'] == 'pagination' ) ) {
428 + include ULTP_PATH . 'blocks/template/pagination.php';
429 + }
430 +
431 + $wraper_after .= '</div>';
432 + $wraper_after .= $pagi_block_html;
433 + $wraper_after .= '</div>';
434 +
435 + wp_reset_query();
436 + } else {
437 + $wraper_before .= ultimate_post()->get_no_result_found_html( $attr['notFoundMessage'] );
438 + }
439 +
440 + return $noAjax ? $post_loop : $wraper_before . $post_loop . $wraper_after;
441 + }
442 +}