Block.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCartBlocks\Blocks\TrialLineItem; |
| 4 | |
| 5 | use SureCartBlocks\Blocks\BaseBlock; |
| 6 | |
| 7 | /** |
| 8 | * Trial Line Item block class |
| 9 | */ |
| 10 | class Block extends BaseBlock { |
| 11 | /** |
| 12 | * Render the block |
| 13 | * |
| 14 | * @param array $attributes Block attributes. |
| 15 | * @param string $content Post content. |
| 16 | * |
| 17 | * @return string |
| 18 | */ |
| 19 | public function render( $attributes, $content ) { |
| 20 | $wrapper_attributes = get_block_wrapper_attributes( [ 'label' => esc_attr( $attributes['label'] ) ] ); |
| 21 | |
| 22 | return wp_sprintf( |
| 23 | '<sc-line-item-trial %s></sc-line-item-trial>', |
| 24 | $wrapper_attributes, |
| 25 | ); |
| 26 | } |
| 27 | } |
| 28 |