Block.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCartBlocks\Blocks\CartBumpLineItem; |
| 4 | |
| 5 | use SureCartBlocks\Blocks\CartBlock; |
| 6 | |
| 7 | /** |
| 8 | * Cart CTA Block. |
| 9 | */ |
| 10 | class Block extends CartBlock { |
| 11 | /** |
| 12 | * Render the block |
| 13 | * |
| 14 | * @param array $attributes Block attributes. |
| 15 | * @param string $content Post content. |
| 16 | * @param object $block Block object. |
| 17 | * |
| 18 | * @return string |
| 19 | */ |
| 20 | public function render( $attributes, $content, $block = null ) { |
| 21 | ob_start(); ?> |
| 22 | |
| 23 | <sc-line-item-bump |
| 24 | label="<?php echo esc_attr( $attributes['label'] ?? '' ); ?>" |
| 25 | class="<?php echo esc_attr( $attributes['className'] ?? '' ); ?>" |
| 26 | style="<?php echo esc_attr( $this->getStyle( $attributes ) ); ?>"></sc-line-item-bump> |
| 27 | |
| 28 | <?php |
| 29 | return ob_get_clean(); |
| 30 | } |
| 31 | } |
| 32 |