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