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