| @@ -13,8 +13,12 @@ | ||
| 13 | 13 | 'blockId' => [ |
| 14 | 14 | 'type' => 'string', |
| 15 | 15 | 'default' => '', |
| 16 | 16 | ], |
| 17 | + 'previewImg' => [ | |
| 18 | + 'type' => 'string', | |
| 19 | + 'default' => '', | |
| 20 | + ], | |
| 17 | 21 | //-------------------------- |
| 18 | 22 | // Image Setting/Style |
| 19 | 23 | //-------------------------- |
| 20 | 24 | 'imageUpload' => [ |
| @@ -38,9 +42,9 @@ | ||
| 38 | 42 | 'default' => 'Image', |
| 39 | 43 | ], |
| 40 | 44 | 'imgAlignment' => [ |
| 41 | 45 | 'type' => 'object', |
| 42 | - 'default' => ['md' => 'left'], | |
| 46 | + 'default' => ['lg' => 'left'], | |
| 43 | 47 | 'style' => [ |
| 44 | 48 | (object)[ |
| 45 | 49 | 'selector'=>'{{ULTP}} .ultp-image-block-wrapper {text-align: {{imgAlignment}};}' |
| 46 | 50 | ], |
| @@ -47,9 +51,9 @@ | ||
| 47 | 51 | ], |
| 48 | 52 | ], |
| 49 | 53 | 'imgWidth' => [ |
| 50 | 54 | 'type' => 'object', |
| 51 | - 'default' => (object)['lg' =>'', 'unit' =>'px'], | |
| 55 | + 'default' => (object)['lg' =>'', 'ulg' =>'px'], | |
| 52 | 56 | 'style' => [ |
| 53 | 57 | (object)[ |
| 54 | 58 | 'selector'=>'{{ULTP}} .ultp-image-block { max-width: {{imgWidth}}; }' |
| 55 | 59 | ], |
| @@ -59,12 +63,21 @@ | ||
| 59 | 63 | 'type' => 'object', |
| 60 | 64 | 'default' => (object)['lg' =>'', 'unit' =>'px'], |
| 61 | 65 | 'style' => [ |
| 62 | 66 | (object)[ |
| 63 | - 'selector'=>'{{ULTP}} .ultp-image-block {object-fit: cover; height: {{imgHeight}}; } {{ULTP}} .ultp-image-block .ultp-image {height: 100%;object-fit: cover; }' | |
| 67 | + 'selector'=>'{{ULTP}} .ultp-image-block {object-fit: cover; height: {{imgHeight}}; } {{ULTP}} .ultp-image-block .ultp-image {height: 100%;}' | |
| 64 | 68 | ], |
| 65 | 69 | ], |
| 66 | 70 | ], |
| 71 | + 'imageScale' => [ | |
| 72 | + 'type' => 'string', | |
| 73 | + 'default' => 'cover', | |
| 74 | + 'style' => [ | |
| 75 | + (object)[ | |
| 76 | + 'selector'=>'{{ULTP}} .ultp-image-block img {object-fit: {{imageScale}};}' | |
| 77 | + ], | |
| 78 | + ], | |
| 79 | + ], | |
| 67 | 80 | 'imgAnimation' => [ |
| 68 | 81 | 'type' => 'string', |
| 69 | 82 | 'default' => 'none', |
| 70 | 83 | ], |
| @@ -170,8 +183,12 @@ | ||
| 170 | 183 | 'selector'=>'{{ULTP}} .ultp-image-block::before { opacity: {{imgOpacity}}; }' |
| 171 | 184 | ], |
| 172 | 185 | ], |
| 173 | 186 | ], |
| 187 | + 'imgLazy' => [ | |
| 188 | + 'type' => 'boolean', | |
| 189 | + 'default' => false, | |
| 190 | + ], | |
| 174 | 191 | |
| 175 | 192 | //Caption |
| 176 | 193 | 'headingText' => [ |
| 177 | 194 | 'type' => 'string', |
| @@ -194,9 +211,9 @@ | ||
| 194 | 211 | ], |
| 195 | 212 | ], |
| 196 | 213 | 'alignment' => [ |
| 197 | 214 | 'type' => 'object', |
| 198 | - 'default' => ['md' => 'left'], | |
| 215 | + 'default' => ['lg' => 'left'], | |
| 199 | 216 | 'style' => [ |
| 200 | 217 | (object)[ |
| 201 | 218 | 'depends' => [ |
| 202 | 219 | (object)['key'=>'headingEnable','condition'=>'==','value'=>true], |
| @@ -257,9 +274,9 @@ | ||
| 257 | 274 | |
| 258 | 275 | //style |
| 259 | 276 | 'btnTypo' => [ |
| 260 | 277 | 'type' => 'object', |
| 261 | - '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' => '', 'decoration' => 'none','family'=>'' ], | |
| 278 | + 'default' => (object)['openTypography' => 1, 'size' => (object)['lg' =>14, 'unit' =>'px'], 'height' => (object)['lg' =>20, 'unit' =>'px'], 'spacing' => (object)['lg' =>0, 'unit' =>'px'], 'transform' => '', 'weight' => '', 'decoration' => 'none','family'=>'' ], | |
| 262 | 279 | 'style' => [ |
| 263 | 280 | (object)[ |
| 264 | 281 | 'depends' => [ |
| 265 | 282 | (object)['key'=>'linkType','condition'=>'==','value'=>'button'], |
| @@ -281,9 +298,9 @@ | ||
| 281 | 298 | ], |
| 282 | 299 | ], |
| 283 | 300 | 'btnBgColor' => [ |
| 284 | 301 | 'type' => 'object', |
| 285 | - 'default' => (object)['openColor' => 1,'type' => 'color', 'color' => '#1740f5'], | |
| 302 | + 'default' => (object)['openColor' => 1,'type' => 'color', 'color' => '#037fff'], | |
| 286 | 303 | 'style' => [ |
| 287 | 304 | (object)[ |
| 288 | 305 | 'depends' => [ |
| 289 | 306 | (object)['key'=>'linkType','condition'=>'==','value'=>'button'], |
| @@ -453,9 +470,9 @@ | ||
| 453 | 470 | ], |
| 454 | 471 | ], |
| 455 | 472 | 'wrapHoverBackground' => [ |
| 456 | 473 | 'type' => 'object', |
| 457 | - 'default' => (object)['openColor' => 0, 'type' => 'color', 'color' => '#1740f5'], | |
| 474 | + 'default' => (object)['openColor' => 0, 'type' => 'color', 'color' => '#037fff'], | |
| 458 | 475 | 'style' => [ |
| 459 | 476 | (object)[ |
| 460 | 477 | 'selector'=>'{{ULTP}} .ultp-block-wrapper:hover' |
| 461 | 478 | ], |
| @@ -510,13 +527,13 @@ | ||
| 510 | 527 | 'type' => 'string', |
| 511 | 528 | 'default' => '', |
| 512 | 529 | ], |
| 513 | 530 | 'advanceZindex' => [ |
| 514 | - 'type' => 'number', | |
| 531 | + 'type' => 'string', | |
| 515 | 532 | 'default' => '', |
| 516 | 533 | 'style' => [ |
| 517 | 534 | (object)[ |
| 518 | - 'selector' => '{{ULTP}} {z-index:{{advanceZindex}};}' | |
| 535 | + 'selector' => '{{ULTP}} .ultp-block-wrapper{z-index:{{advanceZindex}};}' | |
| 519 | 536 | ], |
| 520 | 537 | ], |
| 521 | 538 | ], |
| 522 | 539 | 'hideExtraLarge' => [ |
| @@ -527,17 +544,8 @@ | ||
| 527 | 544 | 'selector' => '{{ULTP}} {display:none;}' |
| 528 | 545 | ], |
| 529 | 546 | ], |
| 530 | 547 | ], |
| 531 | - 'hideDesktop' => [ | |
| 532 | - 'type' => 'boolean', | |
| 533 | - 'default' => false, | |
| 534 | - 'style' => [ | |
| 535 | - (object)[ | |
| 536 | - 'selector' => '{{ULTP}} {display:none;}' | |
| 537 | - ], | |
| 538 | - ], | |
| 539 | - ], | |
| 540 | 548 | 'hideTablet' => [ |
| 541 | 549 | 'type' => 'boolean', |
| 542 | 550 | 'default' => false, |
| 543 | 551 | 'style' => [ |
| @@ -578,11 +586,10 @@ | ||
| 578 | 586 | |
| 579 | 587 | public function register() { |
| 580 | 588 | register_block_type( 'ultimate-post/image', |
| 581 | 589 | array( |
| 590 | + // 'title' => __('Image', 'ultimate-post'), | |
| 582 | 591 | 'attributes' => $this->get_attributes(), |
| 583 | - 'description' => __( 'Show heading or title with ultimate controls.' ), | |
| 584 | - 'keywords' => [ __( 'heading' ), __( 'title' ), __( 'section' ) ], | |
| 585 | 592 | 'render_callback' => array($this, 'content') |
| 586 | 593 | ) |
| 587 | 594 | ); |
| 588 | 595 | } |
| @@ -598,11 +605,11 @@ | ||
| 598 | 605 | // Single Image |
| 599 | 606 | $img_arr = (array)$attr['imageUpload']; |
| 600 | 607 | if( !empty($img_arr) ){ |
| 601 | 608 | if( ($attr['linkType'] == 'link') && $attr['imgLink'] ){ |
| 602 | - $wraper_before .= '<a href="'.$attr['imgLink'].'" target="'.$attr['linkTarget'].'">'.ultimate_post()->get_image_html($img_arr['url'], 'full', 'ultp-image', $attr['imgAlt']).'</a>'; | |
| 609 | + $wraper_before .= '<a href="'.$attr['imgLink'].'" target="'.$attr['linkTarget'].'">'.ultimate_post()->get_image_html($img_arr['url'], 'full', 'ultp-image', $attr['imgAlt'], $attr['imgLazy']).'</a>'; | |
| 603 | 610 | } else { |
| 604 | - $wraper_before .= ultimate_post()->get_image_html($img_arr['url'], 'full', 'ultp-image', $attr['imgAlt']); | |
| 611 | + $wraper_before .= ultimate_post()->get_image_html($img_arr['url'], 'full', 'ultp-image', $attr['imgAlt'], $attr['imgLazy']); | |
| 605 | 612 | } |
| 606 | 613 | } |
| 607 | 614 | if( $attr['btnLink'] && ($attr['linkType'] == 'button') ){ |
| 608 | 615 | $wraper_before .= '<div class="ultp-image-button ultp-image-button-'.$attr['btnPosition'].'"><a href="'.$attr['btnLink'].'" target="'.$attr['btnTarget'].'">'.$attr['btnText'].'</a></div>'; |