[$this, 'render'] ) ); } function render( $attributes ){ extract( $attributes ); $align = $align ?? ''; $cId = $cId ?? ''; $type = $type ?? 'general'; $width = $width ?? '100%'; $alignment = $alignment ?? 'center'; $textAlign = $textAlign ?? 'center'; $message = $message ?? 'You have an alert message!'; $icon = $icon ?? array( 'class' => 'fa fa-exclamation-circle' ); $isDismiss = $isDismiss ?? true; $typography = $typography ?? array( 'fontSize' => 25 ); $colors = $colors ?? array( 'color' => '#333', 'bg' => '#fff' ); $padding = $padding ?? array( 'vertical' => '15px', 'horizontal' => '30px' ); $border = $border ?? array( 'width' => '2px', 'color' => '#333', 'radius' => '8px' ); $shadow = $shadow ?? array(); // Generate Styles $alertStyle = new BBlocksStyleGenerator(); // Generate Styles $alertStyle::addStyle("#bBlocksAlert-$cId .bBlocksAlert", array( 'text-align' => $alignment )); $alertStyle::addStyle("#bBlocksAlert-$cId .bBlocksAlert .alert", array( 'text-align' => $textAlign, 'width' => '0px' === $width || '0%' === $width || '0em' === $width ? 'auto' : $width, $typography['styles'] ?? 'font-size: 25px;' => '', $colors['styles'] ?? 'color: #333; background: #fff;' => '', 'padding' => $padding['styles'] ?? '15px 30px', $border['styles'] ?? 'border: 2px solid #333; border-radius: 8px;' => '', 'box-shadow' => $shadow['styles'] ?? 'none' )); $alertStyle::addStyle("#bBlocksAlert-$cId .bBlocksAlert .alert .alertIcon", array( 'font-size' => $typography['fontSize'] ?? '25px', 'color' => $colors['color'] ?? '#333' )); $alertStyle::addStyle("#bBlocksAlert-$cId .bBlocksAlert .alert .alertClose", array( 'color' => $colors['color'] ?? '#333' )); ob_start(); ?>
' id='bBlocksAlert-'>
" : ''; ?> " : ''; ?>