| 1 |
<?php |
| 2 |
/** |
| 3 |
* Registry of the blocks TableKit provides |
| 4 |
* |
| 5 |
* @package TableKit |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace TableBuilder\Config; |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit; |
| 11 |
|
| 12 |
/** |
| 13 |
* Provides the filterable list of block definitions TableKit registers. |
| 14 |
*/ |
| 15 |
class BlockList { |
| 16 |
|
| 17 |
|
| 18 |
/** |
| 19 |
* Gets the list of blocks TableKit registers, filterable so the Pro |
| 20 |
* add-on (and third parties) can extend it with additional block definitions. |
| 21 |
* |
| 22 |
* @return array<string, array{slug:string,title:string,package:string,category:string,status:string,parent?:string,badge?:string[]}> |
| 23 |
* Block definitions keyed by block key. |
| 24 |
*/ |
| 25 |
public static function get_block_list() { |
| 26 |
/** |
| 27 |
* Filters the list of block definitions TableKit registers. |
| 28 |
* |
| 29 |
* @since Unknown |
| 30 |
* |
| 31 |
* @param array $list Block definitions keyed by block key; see get_block_list() for the shape. |
| 32 |
*/ |
| 33 |
$list = apply_filters( |
| 34 |
// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores -- slash-namespaced hook name is this plugin's established public API (used by the Pro add-on); renaming would be a breaking change. |
| 35 |
'tablebuilder/blocks/list', |
| 36 |
array( |
| 37 |
'table-builder' => array( |
| 38 |
'slug' => 'table-builder', |
| 39 |
'title' => 'Table Builder', |
| 40 |
'package' => 'free', |
| 41 |
'category' => 'general', |
| 42 |
'status' => 'active', |
| 43 |
'badge' => array( 'freemium', 'new', 'beta' ), |
| 44 |
), |
| 45 |
'table-builder-row' => array( |
| 46 |
'slug' => 'table-builder-row', |
| 47 |
'title' => 'Table Row', |
| 48 |
'package' => 'free', |
| 49 |
'category' => 'general', |
| 50 |
'parent' => 'table-builder', |
| 51 |
'status' => 'active', |
| 52 |
), |
| 53 |
'table-builder-item' => array( |
| 54 |
'slug' => 'table-builder-item', |
| 55 |
'title' => 'Table Column', |
| 56 |
'package' => 'free', |
| 57 |
'category' => 'general', |
| 58 |
'parent' => 'table-builder-row', |
| 59 |
'status' => 'active', |
| 60 |
), |
| 61 |
'data-table' => array( |
| 62 |
'slug' => 'data-table', |
| 63 |
'title' => 'Data Table', |
| 64 |
'package' => 'pro', |
| 65 |
'category' => 'general', |
| 66 |
'status' => 'active', |
| 67 |
), |
| 68 |
'post-table' => array( |
| 69 |
'slug' => 'post-table', |
| 70 |
'title' => 'Post Table', |
| 71 |
'package' => 'pro', |
| 72 |
'category' => 'general', |
| 73 |
'status' => 'active', |
| 74 |
), |
| 75 |
) |
| 76 |
); |
| 77 |
|
| 78 |
return $list; |
| 79 |
} |
| 80 |
} |
| 81 |
|