Block.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCartBlocks\Blocks\Dashboard\CustomerDownloads; |
| 4 | |
| 5 | use SureCart\Models\User; |
| 6 | use SureCartBlocks\Blocks\Dashboard\DashboardPage; |
| 7 | use SureCartBlocks\Controllers\DownloadController; |
| 8 | |
| 9 | /** |
| 10 | * Checkout block |
| 11 | */ |
| 12 | class Block extends DashboardPage { |
| 13 | /** |
| 14 | * Render the preview (overview) |
| 15 | * |
| 16 | * @param array $attributes Block attributes. |
| 17 | * @param string $content Post content. |
| 18 | * |
| 19 | * @return function |
| 20 | */ |
| 21 | public function render( $attributes, $content ) { |
| 22 | if ( ! is_user_logged_in() ) { |
| 23 | return; |
| 24 | } |
| 25 | |
| 26 | return ( new DownloadController() )->preview( $attributes ); |
| 27 | } |
| 28 | } |
| 29 |