[$this, 'render'] ) ); } function render( $attributes ){ extract( $attributes ); $align = $align ?? ''; $cId = $cId ?? ''; $layout = $layout ?? 'default'; $boxIsInline = $boxIsInline ?? false; $boxPosition = $boxPosition ?? 'center'; $isLabels = $isLabels ?? true; $isDays = $isDays ?? true; $daysLabel = $daysLabel ?? 'Days'; $isHours = $isHours ?? true; $hoursLabel = $hoursLabel ?? 'Hours'; $isMinutes = $isMinutes ?? true; $minutesLabel = $minutesLabel ?? 'Minutes'; $isSeconds = $isSeconds ?? true; $secondsLabel = $secondsLabel ?? 'Seconds'; $width = $width ?? '0px'; $background = $background ?? array( 'color' => '#0000' ); $padding = $padding ?? array( 'vertical' => '10px', 'horizontal' => '15px' ); $shadow = $shadow ?? array(); $alignment = $alignment ?? 'center'; $boxBG = $boxBG ?? array( 'type' => 'gradient', 'color' => '#4527a4', 'gradient' => 'linear-gradient(135deg, #4527a4, #8344c5)' ); $boxWidth = $boxWidth ?? '170px'; $boxHeight = $boxHeight ?? '120px'; $boxSpace = $boxSpace ?? '30px'; $boxBorder = $boxBorder ?? array( 'radius' => '5%' ); $boxShadow = $boxShadow ?? array(); $digitTypo = $digitTypo ?? array( 'fontSize' => 48 ); $digitColor = $digitColor ?? '#fff'; $labelTypo = $labelTypo ?? array( 'fontSize' => 18 ); $labelColor = $labelColor ?? '#fff'; $isSep = $isSep ?? false; $sepType = $sepType ?? ':'; $sepSize = $sepSize ?? 52; $sepColor = $sepColor ?? '#4527a4'; // Generate Styles $countdownStyle = new BBlocksStyleGenerator(); $countdownStyle::addStyle( "#bBlocksCountdown-$cId", array( 'align-items' => $alignment, 'justify-content' => $alignment ) ); $countdownStyle::addStyle( "#bBlocksCountdown-$cId .countdownItems", array( 'width' => '0px' === $width || '0%' === $width || '0em' === $width ? 'auto' : $width, $background['styles'] ?? 'background-color: #0000;' => '', 'padding' => $padding['styles'] ?? '10px 15px', 'box-shadow' => $shadow['styles'] ?? 'none', 'justify-content' => $boxPosition ) ); $countdownStyle::addStyle( "#bBlocksCountdown-$cId .countdownItems .countdownItem", array( $boxBG['styles'] ?? 'background-image: linear-gradient(135deg, #4527a4, #8344c5);' => '', 'width' => $boxWidth, 'height' => $boxHeight, 'margin-left' => "calc($boxSpace / 2)", 'margin-right' => "calc($boxSpace / 2)", $boxBorder['styles'] ?? 'border-radius: 5%;' => '', 'box-shadow' => $boxShadow['styles'] ?? '0 0 0 0 #0000' ) ); $countdownStyle::addStyle( "#bBlocksCountdown-$cId .countdownItems .separator::before", array( 'content' => "'$sepType'", 'font-size' => $sepSize . 'px', 'color' => $sepColor ) ); $countdownStyle::addStyle( "#bBlocksCountdown-$cId .countdownItems .countdownItem .digit", array( 'color' => $digitColor, $digitTypo['styles'] ?? 'font-size: 48px;' => '' ) ); $countdownStyle::addStyle( "#bBlocksCountdown-$cId .countdownItems .countdownItem .label", array( 'color' => $labelColor, $labelTypo['styles'] ?? 'font-size: 18px;' => '' ) ); $boxClass = $boxIsInline ? 'inline' : ''; ob_start(); ?>
' id='bBlocksCountdown-' data-date=" $destDate ?? '' ) ) ); ?>">
box( $isDays, "countdownDays $boxClass", $isLabels, $daysLabel ); ?> " : ''; ?> box( $isHours, "countdownHours $boxClass", $isLabels, $hoursLabel ); ?> " : ''; ?> box( $isMinutes, "countdownMinutes $boxClass", $isLabels, $minutesLabel ); ?> " : ''; ?> box( $isSeconds, "countdownSeconds $boxClass", $isLabels, $secondsLabel ); ?>
00 ". wp_kses_post( $label ) ."" : ''; ?>