$this->attributes(), 'render_callback' => [$this, 'render'] ) ); } function attributes(){ return array( 'align' => array( 'type' => 'string', 'default' => '' ), 'cId' => array( 'type' => 'string', 'default' => '' ), 'images' => array( 'type' => 'array', 'default' => array() ), 'columns' => array( 'type' => 'object', 'default' => array( 'desktop' => 3, 'tablet' => 2, 'mobile' => 1 ) ), 'imgPadding' => array( 'type' => 'object', 'default' => array() ), 'imgBorder' => array( 'type' => 'object', 'default' => array() ), 'imgShadow' => array( 'type' => 'object', 'default' => array() ), 'isCap' => array( 'type' => 'boolean', 'default' => true ), 'capAlign' => array( 'type' => 'string', 'default' => 'left' ), 'capColor' => array( 'type' => 'string', 'default' => '#333' ), 'capTitleTypo' => array( 'type' => 'object', 'default' => array( 'fontSize' => 18 ) ), 'capDescTypo' => array( 'type' => 'object', 'default' => array( 'fontSize' => 15 ) ) ); } function render( $attributes ){ extract( $attributes ); // Generate Styles $imgShadow = $imgShadow['styles'] ?? ''; $imgPaddingH = $imgPadding['horizontal'] ?? '0px'; $imgPaddingV = $imgPadding['vertical'] ?? '0px'; $imageGalleryStyle = new BBlocksStyleGenerator(); $imageGalleryStyle::addStyle( "#bBlocksImageGallery-$cId .imgGalleryWrapper .imgGalleryImgLink .imgGalleryImg", array( 'padding' => $imgPadding['styles'] ?? '0 0', $imgBorder['styles'] ?? '' => '', 'filter' => "drop-shadow($imgShadow)" ) ); $imageGalleryStyle::addStyle( "#bBlocksImageGallery-$cId .imgGalleryWrapper .imgGalleryImgLink .imgGalleryImgCaption", array( 'text-align' => $capAlign, 'color' => $capColor, 'margin' => $imgPadding['styles'] ?? '0 0', 'width' => "calc((100% - 10px) - ($imgPaddingH * 2) )", 'height' => "calc((100% - 10px) - ($imgPaddingV * 2) )", 'border-radius' => $imgBorder['radius'] ?? '0px' ) ); $imageGalleryStyle::addStyle( "#bBlocksImageGallery-$cId .imgGalleryWrapper .imgGalleryImgLink .imgGalleryImgCaption h4", array( $capTitleTypo['styles'] ?? 'font-size: 18px;' => '' ) ); $imageGalleryStyle::addStyle( "#bBlocksImageGallery-$cId .imgGalleryWrapper .imgGalleryImgLink .imgGalleryImgCaption p", array( $capDescTypo['styles'] ?? 'font-size: 15px;' => '' ) ); ob_start(); ?>