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