table.php in Getwid – Gutenberg Blocks 3.0.2, at includes/blocks/table.php
| 1 | <?php |
| 2 | |
| 3 | namespace Getwid\Blocks; |
| 4 | |
| 5 | class Table extends AbstractBlock { |
| 6 | |
| 7 | public function __construct() { |
| 8 | |
| 9 | parent::__construct( 'getwid/table' ); |
| 10 | |
| 11 | register_block_type( |
| 12 | getwid_get_plugin_path( 'assets/blocks/table' ), |
| 13 | array( |
| 14 | 'render_callback' => array( $this, 'render_callback' ), |
| 15 | ) |
| 16 | ); |
| 17 | } |
| 18 | |
| 19 | public function get_label() { |
| 20 | return __( 'Table', 'getwid' ); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | getwid()->blocksManager()->addBlock( |
| 25 | new Table() |
| 26 | ); |
| 27 |