PluginProbe
Post Grid Gutenberg Blocks – PostX / 2.9.2
Post Grid Gutenberg Blocks – PostX v2.9.2
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 2.1.2 All 237 releases
ultimate-post / blocks / Heading.php

Heading.php in Post Grid Gutenberg Blocks – PostX 2.9.2, at blocks/Heading.php

754 lines 35.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ULTP\blocks;
3
4 defined('ABSPATH') || exit;
5
6 class Heading{
7 public function __construct() {
8 add_action('init', array($this, 'register'));
9 }
10 public function get_attributes($default = false) {
11
12 $attributes = array(
13 'blockId' => [
14 'type' => 'string',
15 'default' => '',
16 ],
17
18 //--------------------------
19 // Heading Setting/Style
20 //--------------------------
21 'headingText' => [
22 'type' => 'string',
23 'default' => 'This is a Heading Example',
24 ],
25 'headingURL' => [
26 'type' => 'string',
27 'default' => '',
28 ],
29 'openInTab' => [
30 'type' => 'boolean',
31 'default' => false,
32 ],
33 'headingBtnText' => [
34 'type' => 'string',
35 'default' => 'View More',
36 'style' => [
37 (object)[
38 'depends' => [
39 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style11'],
40 ],
41 ],
42 ],
43 ],
44 'headingStyle' => [
45 'type' => 'string',
46 'default' => 'style9',
47 // 'condition' => [
48 // 'style1' => (object)['headingAlign' => 'center'],
49 // 'style2' => (object)['headingAlign' => 'right'],
50 // ]
51 ],
52 'headingTag' => [
53 'type' => 'string',
54 'default' => 'h2',
55 ],
56 'headingAlign' => [
57 'type' => 'string',
58 'default' => 'left',
59 'style' => [(object)['selector' => '{{ULTP}} .ultp-heading-inner, {{ULTP}} .ultp-sub-heading-inner{ text-align:{{headingAlign}}; }']]
60 ],
61 'headingTypo' => [
62 'type' => 'object',
63 'default' => (object)['openTypography' => 1,'size' => (object)['lg' => '20', 'unit' => 'px'], 'height' => (object)['lg' => '', 'unit' => 'px'],'decoration' => 'none', 'transform' => '', 'family'=>'','weight'=>'700'],
64 'style' => [(object)['selector' => '{{ULTP}} .ultp-heading-wrap .ultp-heading-inner']]
65 ],
66 'headingColor' => [
67 'type' => 'string',
68 'default' => '#0e1523',
69 'style' => [(object)['selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { color:{{headingColor}}; }']],
70 ],
71 'headingBorderBottomColor' => [
72 'type' => 'string',
73 'default' => '#0e1523',
74 'style' => [
75 (object)[
76 'depends' => [
77 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
78 ],
79 'selector'=>'{{ULTP}} .ultp-heading-inner { border-bottom-color:{{headingBorderBottomColor}}; }'
80 ],
81 (object)[
82 'depends' => [
83 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style4'],
84 ],
85 'selector'=>'{{ULTP}} .ultp-heading-inner { border-color:{{headingBorderBottomColor}}; }'
86 ],
87 (object)[
88 'depends' => [
89 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style6'],
90 ],
91 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { background-color: {{headingBorderBottomColor}}; }'
92 ],
93 (object)[
94 'depends' => [
95 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style7'],
96 ],
97 'selector'=>'{{ULTP}} .ultp-heading-inner span:before, {{ULTP}}
98 .ultp-heading-inner span:after { background-color: {{headingBorderBottomColor}}; }'
99 ],
100 (object)[
101 'depends' => [
102 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style8'],
103 ],
104 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor}}; }'
105 ],
106 (object)[
107 'depends' => [
108 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style9'],
109 ],
110 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor}}; }'
111 ],
112 (object)[
113 'depends' => [
114 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style10'],
115 ],
116 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor}}; }'
117 ],
118 (object)[
119 'depends' => [
120 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
121 ],
122 'selector'=>'{{ULTP}} .ultp-heading-inner { border-color:{{headingBorderBottomColor}}; }'
123 ],
124 (object)[
125 'depends' => [
126 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style14'],
127 ],
128 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor}}; }'
129 ],
130 (object)[
131 'depends' => [
132 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style15'],
133 ],
134 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { background-color:{{headingBorderBottomColor}}; }'
135 ],
136 (object)[
137 'depends' => [
138 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style16'],
139 ],
140 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { background-color:{{headingBorderBottomColor}}; }'
141 ],
142 (object)[
143 'depends' => [
144 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style17'],
145 ],
146 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor}}; }'
147 ],
148 (object)[
149 'depends' => [
150 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
151 ],
152 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor}}; }'
153 ],
154 (object)[
155 'depends' => [
156 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style19'],
157 ],
158 'selector'=>'{{ULTP}} .ultp-heading-inner:before { border-color:{{headingBorderBottomColor}}; }'
159 ],
160 ],
161 ],
162 'headingBorderBottomColor2' => [
163 'type' => 'string',
164 'default' => '#e5e5e5',
165 'style' => [
166 (object)[
167 'depends' => [
168 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style8'],
169 ],
170 'selector'=>'{{ULTP}} .ultp-heading-inner:before { background-color:{{headingBorderBottomColor2}}; }'
171 ],
172 (object)[
173 'depends' => [
174 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style10'],
175 ],
176 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor2}}; }'
177 ],
178 (object)[
179 'depends' => [
180 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style14'],
181 ],
182 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor2}}; }'
183 ],
184 (object)[
185 'depends' => [
186 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style19'],
187 ],
188 'selector'=>'{{ULTP}} .ultp-heading-inner:after { background-color:{{headingBorderBottomColor2}}; }'
189 ],
190 ],
191 ],
192 'headingBg' => [
193 'type' => 'string',
194 'default' => '#037fff',
195 'style' => [
196 (object)[
197 'depends' => [
198 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style5'],
199 ],
200 'selector'=>'{{ULTP}} .ultp-heading-style5 .ultp-heading-inner span:before { border-color:{{headingBg}} transparent transparent; } {{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
201 ],
202 (object)[
203 'depends' => [
204 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style2'],
205 ],
206 'selector'=>'{{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
207 ],
208
209 (object)[
210 'depends' => [
211 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style21'],
212 ],
213 'selector'=>'{{ULTP}} .ultp-heading-inner span, {{ULTP}} .ultp-heading-inner span:after { background-color:{{headingBg}}; }'
214 ],
215 (object)[
216 'depends' => [
217 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
218 ],
219 'selector'=>'{{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
220 ],
221 (object)[
222 'depends' => [
223 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style12'],
224 ],
225 'selector'=>'{{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
226 ],
227 (object)[
228 'depends' => [
229 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
230 ],
231 'selector'=>'{{ULTP}} .ultp-heading-inner span { background-color:{{headingBg}}; }'
232 ],
233 (object)[
234 'depends' => [
235 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
236 ],
237 'selector'=>'{{ULTP}} .ultp-heading-inner { background-color:{{headingBg}}; }'
238 ],
239 (object)[
240 'depends' => [
241 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style20'],
242 ],
243 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { border-color:{{headingBg}} transparent transparent; } {{ULTP}} .ultp-heading-inner { background-color:{{headingBg}}; }'
244 ],
245 ],
246 ],
247 'headingBg2' => [
248 'type' => 'string',
249 'default' => '#e5e5e5',
250 'style' => [
251 (object)[
252 'depends' => [
253 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style12'],
254 ],
255 'selector'=>'{{ULTP}} .ultp-heading-inner { background-color:{{headingBg2}}; }'
256 ],
257 ],
258 ],
259 'headingBtnTypo' => [
260 'type' => 'object',
261 'default' => (object)['openTypography' => 1,'size' => (object)['lg' => '14', 'unit' => 'px'], 'height' => (object)['lg' => '', 'unit' => 'px'],'decoration' => 'none','family'=>''],
262 'style' => [
263 (object)[
264 'depends' => [
265 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style11'],
266 ],
267 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-btn'
268 ],
269 ],
270 ],
271 'headingBtnColor' => [
272 'type' => 'string',
273 'default' => '#037fff',
274 'style' => [
275 (object)[
276 'depends' => [
277 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style11'],
278 ],
279 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-btn { color:{{headingBtnColor}}; } {{ULTP}} .ultp-heading-wrap .ultp-heading-btn svg { fill:{{headingBtnColor}}; }'
280 ],
281 ],
282 ],
283 'headingBtnHoverColor' => [
284 'type' => 'string',
285 'default' => '#0a31da',
286 'style' => [
287 (object)[
288 'depends' => [
289 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style11'],
290 ],
291 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-btn:hover { color:{{headingBtnHoverColor}}; } {{ULTP}} .ultp-heading-wrap .ultp-heading-btn:hover svg { fill:{{headingBtnHoverColor}}; }'
292 ],
293 ],
294 ],
295
296 'headingBorder' => [
297 'type' => 'string',
298 'default' => '3',
299 'style' => [
300 (object)[
301 'depends' => [
302 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
303 ],
304 'selector'=>'{{ULTP}} .ultp-heading-inner { border-bottom-width:{{headingBorder}}px; }'
305 ],
306 (object)[
307 'depends' => [
308 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style4'],
309 ],
310 'selector'=>'{{ULTP}} .ultp-heading-inner { border-width:{{headingBorder}}px; }'
311 ],
312 (object)[
313 'depends' => [
314 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style6'],
315 ],
316 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { width:{{headingBorder}}px; }'
317 ],
318 (object)[
319 'depends' => [
320 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style7'],
321 ],
322 'selector'=>'{{ULTP}} .ultp-heading-inner span:before, {{ULTP}} .ultp-heading-inner span:after { height:{{headingBorder}}px; }'
323 ],
324 (object)[
325 'depends' => [
326 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style8'],
327 ],
328 'selector'=>'{{ULTP}} .ultp-heading-inner:before, {{ULTP}} .ultp-heading-inner:after { height:{{headingBorder}}px; }'
329 ],
330 (object)[
331 'depends' => [
332 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style9'],
333 ],
334 'selector'=>'{{ULTP}} .ultp-heading-inner:before { height:{{headingBorder}}px; }'
335 ],
336 (object)[
337 'depends' => [
338 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style10'],
339 ],
340 'selector'=>'{{ULTP}} .ultp-heading-inner:before, {{ULTP}} .ultp-heading-inner:after { height:{{headingBorder}}px; }'
341 ],
342 (object)[
343 'depends' => [
344 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
345 ],
346 'selector'=>'{{ULTP}} .ultp-heading-inner { border-width:{{headingBorder}}px; }'
347 ],
348 (object)[
349 'depends' => [
350 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style14'],
351 ],
352 'selector'=>'{{ULTP}} .ultp-heading-inner:before, {{ULTP}} .ultp-heading-inner:after { height:{{headingBorder}}px; }'
353 ],
354 (object)[
355 'depends' => [
356 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style15'],
357 ],
358 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { height:{{headingBorder}}px; }'
359 ],
360 (object)[
361 'depends' => [
362 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style16'],
363 ],
364 'selector'=>'{{ULTP}} .ultp-heading-inner span:before { height:{{headingBorder}}px; }'
365 ],
366 (object)[
367 'depends' => [
368 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style17'],
369 ],
370 'selector'=>'{{ULTP}} .ultp-heading-inner:before { height:{{headingBorder}}px; }'
371 ],
372 (object)[
373 'depends' => [
374 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style19'],
375 ],
376 'selector'=>'{{ULTP}} .ultp-heading-inner:after { width:{{headingBorder}}px; }'
377 ],
378 (object)[
379 'depends' => [
380 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
381 ],
382 'selector'=>'{{ULTP}} .ultp-heading-inner:after { width:{{headingBorder}}px; }'
383 ],
384 ],
385 ],
386 'headingSpacing' => [
387 'type' => 'object',
388 'default' => (object)['lg'=>20, 'sm'=>10, 'unit'=>'px'],
389 'style' => [(object)['selector'=>'{{ULTP}} .ultp-heading-wrap {margin-top:0; margin-bottom:{{headingSpacing}}; }']]
390 ],
391
392 'headingRadius' => [
393 'type' => 'object',
394 'default' => (object)['lg' =>(object)['top' => '','bottom' => '','left' => '', 'right' => '', 'unit' =>'px']],
395 'style' => [
396 (object)[
397 'depends' => [
398 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style2'],
399 ],
400 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { border-radius:{{headingRadius}}; }'
401 ],
402 (object)[
403 'depends' => [
404 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
405 ],
406 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { border-radius:{{headingRadius}}; }'
407 ],
408 (object)[
409 'depends' => [
410 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style4'],
411 ],
412 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
413 ],
414 (object)[
415 'depends' => [
416 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style5'],
417 ],
418 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { border-radius:{{headingRadius}}; }'
419 ],
420 (object)[
421 'depends' => [
422 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style12'],
423 ],
424 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
425 ],
426 (object)[
427 'depends' => [
428 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
429 ],
430 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
431 ],
432 (object)[
433 'depends' => [
434 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
435 ],
436 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
437 ],
438 (object)[
439 'depends' => [
440 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style20'],
441 ],
442 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner { border-radius:{{headingRadius}}; }'
443 ],
444 ]
445 ],
446
447 'headingPadding' => [
448 'type' => 'object',
449 'default' => (object)['lg' =>(object)['unit' =>'px']],
450 'style' => [
451 (object)[
452 'depends' => [
453 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style2'],
454 ],
455 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
456 ],
457 (object)[
458 'depends' => [
459 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style3'],
460 ],
461 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
462 ],
463 (object)[
464 'depends' => [
465 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style4'],
466 ],
467 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
468 ],
469 (object)[
470 'depends' => [
471 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style5'],
472 ],
473 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
474 ],
475 (object)[
476 'depends' => [
477 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style6'],
478 ],
479 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
480 ],
481 (object)[
482 'depends' => [
483 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style12'],
484 ],
485 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
486 ],
487 (object)[
488 'depends' => [
489 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style13'],
490 ],
491 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
492 ],
493 (object)[
494 'depends' => [
495 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style18'],
496 ],
497 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
498 ],
499 (object)[
500 'depends' => [
501 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style19'],
502 ],
503 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
504 ],
505 (object)[
506 'depends' => [
507 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style20'],
508 ],
509 'selector'=>'{{ULTP}} .ultp-heading-wrap .ultp-heading-inner span { padding:{{headingPadding}}; }'
510 ],
511 (object)[
512 'depends' => [
513 (object)['key'=>'headingStyle','condition'=>'==','value'=>'style21'],
514 ],
515 'selector'=>'{{ULTP}} .ultp-heading-inner span { padding:{{headingPadding}}; }'
516 ],
517 ]
518 ],
519 'subHeadingShow' => [
520 'type' => 'boolean',
521 'default' => false,
522 ],
523 'subHeadingText' => [
524 'type' => 'string',
525 'default' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut sem augue. Sed at felis ut enim dignissim sodales.',
526 'style' => [
527 (object)[
528 'depends' => [
529 (object)['key'=>'subHeadingShow','condition'=>'==','value'=>true],
530 ],
531 ],
532 ],
533 ],
534 'subHeadingTypo' => [
535 'type' => 'object',
536 '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' => '','family'=>'','weight'=>'500'],
537 'style' => [
538 (object)[
539 'depends' => [
540 (object)['key'=>'subHeadingShow','condition'=>'==','value'=>true],
541 ],
542 'selector'=>'{{ULTP}} .ultp-sub-heading div'
543 ],
544 ],
545 ],
546 'subHeadingColor' => [
547 'type' => 'string',
548 'default' => '#989898',
549 'style' => [
550 (object)[
551 'depends' => [
552 (object)['key'=>'subHeadingShow','condition'=>'==','value'=>true],
553 ],
554 'selector'=>'{{ULTP}} .ultp-sub-heading div{ color:{{subHeadingColor}}; }'
555 ],
556 ],
557 ],
558 'subHeadingSpacing' => [
559 'type' => 'object',
560 'default' => (object)['lg' =>(object)['top' => '8', 'unit' =>'px']],
561 'style' => [
562 (object)[
563 'depends' => [
564 (object)['key'=>'subHeadingShow','condition'=>'==','value'=>true],
565 ],
566 'selector'=>'{{ULTP}} div.ultp-sub-heading-inner{ margin:{{subHeadingSpacing}}; }'
567 ],
568 ],
569 ],
570
571 //--------------------------
572 // Wrapper Style
573 //--------------------------
574 'wrapBg' => [
575 'type' => 'object',
576 'default' => (object)['openColor' => 0, 'type' => 'color', 'color' => '#f5f5f5'],
577 'style' => [
578 (object)[
579 'selector'=>'{{ULTP}} .ultp-block-wrapper'
580 ],
581 ],
582 ],
583 'wrapBorder' => [
584 'type' => 'object',
585 'default' => (object)['openBorder'=>0, 'width' =>(object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
586 'style' => [
587 (object)[
588 'selector'=>'{{ULTP}} .ultp-block-wrapper'
589 ],
590 ],
591 ],
592 'wrapShadow' => [
593 'type' => 'object',
594 'default' => (object)['openShadow' => 0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4'],
595 'style' => [
596 (object)[
597 'selector'=>'{{ULTP}} .ultp-block-wrapper'
598 ],
599 ],
600 ],
601 'wrapRadius' => [
602 'type' => 'object',
603 'default' => (object)['lg' =>'', 'unit' =>'px'],
604 'style' => [
605 (object)[
606 'selector'=>'{{ULTP}} .ultp-block-wrapper { border-radius:{{wrapRadius}}; }'
607 ],
608 ],
609 ],
610 'wrapHoverBackground' => [
611 'type' => 'object',
612 'default' => (object)['openColor' => 0, 'type' => 'color', 'color' => '#037fff'],
613 'style' => [
614 (object)[
615 'selector'=>'{{ULTP}} .ultp-block-wrapper:hover'
616 ],
617 ],
618 ],
619 'wrapHoverBorder' => [
620 'type' => 'object',
621 'default' => (object)['openBorder'=>0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4','type' => 'solid'],
622 'style' => [
623 (object)[
624 'selector'=>'{{ULTP}} .ultp-block-wrapper:hover'
625 ],
626 ],
627 ],
628 'wrapHoverRadius' => [
629 'type' => 'object',
630 'default' => (object)['lg' =>'', 'unit' =>'px'],
631 'style' => [
632 (object)[
633 'selector'=>'{{ULTP}} .ultp-block-wrapper:hover { border-radius:{{wrapHoverRadius}}; }'
634 ],
635 ],
636 ],
637 'wrapHoverShadow' => [
638 'type' => 'object',
639 'default' => (object)['openShadow' => 0, 'width' => (object)['top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1],'color' => '#009fd4'],
640 'style' => [
641 (object)[
642 'selector'=>'{{ULTP}} .ultp-block-wrapper:hover'
643 ],
644 ],
645 ],
646 'wrapMargin' => [
647 'type' => 'object',
648 'default' => (object)['lg' =>(object)['top' => '','bottom' => '', 'unit' =>'px']],
649 'style' => [
650 (object)[
651 'selector'=>'{{ULTP}} .ultp-block-wrapper { margin:{{wrapMargin}}; }'
652 ],
653 ],
654 ],
655 'wrapOuterPadding' => [
656 'type' => 'object',
657 'default' => (object)['lg' =>(object)['top' => '','bottom' => '','left' => '', 'right' => '', 'unit' =>'px']],
658 'style' => [
659 (object)[
660 'selector'=>'{{ULTP}} .ultp-block-wrapper { padding:{{wrapOuterPadding}}; }'
661 ],
662 ],
663 ],
664 'advanceId' => [
665 'type' => 'string',
666 'default' => '',
667 ],
668 'advanceZindex' => [
669 'type' => 'string',
670 'default' => '',
671 'style' => [
672 (object)[
673 'selector' => '{{ULTP}} .ultp-block-wrapper{z-index:{{advanceZindex}};}'
674 ],
675 ],
676 ],
677 'hideExtraLarge' => [
678 'type' => 'boolean',
679 'default' => false,
680 'style' => [
681 (object)[
682 'selector' => '{{ULTP}} {display:none;}'
683 ],
684 ],
685 ],
686 'hideTablet' => [
687 'type' => 'boolean',
688 'default' => false,
689 'style' => [
690 (object)[
691 'selector' => '{{ULTP}} {display:none;}'
692 ],
693 ],
694 ],
695 'hideMobile' => [
696 'type' => 'boolean',
697 'default' => false,
698 'style' => [
699 (object)[
700 'selector' => '{{ULTP}} {display:none;}'
701 ],
702 ],
703 ],
704 'advanceCss' => [
705 'type' => 'string',
706 'default' => '',
707 'style' => [
708 (object)[
709 'selector' => '{{ULTP}} {display:none;}'
710 ],
711 ],
712 ],
713 );
714
715 if ($default) {
716 $temp = array();
717 foreach ($attributes as $key => $value) {
718 if (isset($value['default'])) {
719 $temp[$key] = $value['default'];
720 }
721 }
722 return $temp;
723 } else {
724 return $attributes;
725 }
726 }
727
728 public function register() {
729 register_block_type( 'ultimate-post/heading',
730 array(
731 'editor_script' => 'ultp-blocks-editor-script',
732 'editor_style' => 'ultp-blocks-editor-css',
733 'attributes' => $this->get_attributes(),
734 'render_callback' => array($this, 'content')
735 )
736 );
737 }
738
739 public function content($attr, $noAjax) {
740
741 $wraper_before = '';
742 $block_name = 'heading';
743 $attr['headingShow'] = true;
744
745 $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"]:'').'">';
746 $wraper_before .= '<div class="ultp-block-wrapper">';
747 include ULTP_PATH.'blocks/template/heading.php';
748 $wraper_before .= '</div>';
749 $wraper_before .= '</div>';
750
751 return $wraper_before;
752 }
753
754 }