{"id":21931315,"url":"https://github.com/themeplate/blocks","last_synced_at":"2026-03-08T11:35:15.711Z","repository":{"id":38476617,"uuid":"501965838","full_name":"ThemePlate/Blocks","owner":"ThemePlate","description":"Easy server-side-rendered blocks","archived":false,"fork":false,"pushed_at":"2025-03-02T07:55:44.000Z","size":201,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T08:25:51.129Z","etag":null,"topics":["wordpress","wordpress-blocks","wordpress-gutenberg"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThemePlate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-10T08:39:13.000Z","updated_at":"2025-03-02T07:55:47.000Z","dependencies_parsed_at":"2022-08-20T04:40:09.547Z","dependency_job_id":"c162f16a-50ef-4666-8f9f-5dd6c8bd76f2","html_url":"https://github.com/ThemePlate/Blocks","commit_stats":{"total_commits":95,"total_committers":1,"mean_commits":95.0,"dds":0.0,"last_synced_commit":"a265fd08c9a5c8d436019efbe1f3ce9c56c79cd5"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FBlocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FBlocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FBlocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FBlocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThemePlate","download_url":"https://codeload.github.com/ThemePlate/Blocks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959454,"owners_count":20538628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress","wordpress-blocks","wordpress-gutenberg"],"created_at":"2024-11-28T23:13:30.919Z","updated_at":"2026-03-08T11:35:15.690Z","avatar_url":"https://github.com/ThemePlate.png","language":"PHP","readme":"# ThemePlate Blocks\n\n## Usage\n```php\nuse ThemePlate\\Blocks\\BlockType;\n\n/** https://developer.wordpress.org/reference/classes/wp_block_type/__construct/#parameters */\n$config = array(\n\t'namespace' =\u003e 'my-blocks',\n\t'template'  =\u003e '/path/to/render.php',\n);\n\n( new BlockType( 'Custom Block', $config ) )-\u003efields( $list )-\u003einit();\n\n/** \u003e= 1.6.0 */\n( new BlockType( __DIR__ . '/tests/example' ) )-\u003einit()\n```\n\n\u003e Check out [example block](/tests/example)\n\n### Restrict inner blocks and prefill components\n```php\n$config = array(\n\t'allowed_blocks'  =\u003e array(\n\t\t'core/image',\n\t\t'core/heading',\n\t\t'core/paragraph',\n\t),\n\t'template_blocks' =\u003e array(\n\t\tarray( 'core/image', array() ),\n\t\tarray( 'core/heading', array( 'placeholder' =\u003e 'Insert title here' ) ),\n\t\tarray( 'core/paragraph', array( 'placeholder' =\u003e 'Insert content copy' ) ),\n\t),\n);\n\n( new BlockType( 'My custom block', $config ) )-\u003efields( $list )-\u003einit();\n\n/** \u003e= 1.6.0 */\n// return in the config.php file beside block.json\nreturn $config;\n```\n\n\u003e Disable nested blocks by setting `$config` key `inner_blocks` to `false`\n\n### Structured *(Bulk)* Definition\n```\n/path/to/blocks/\n├── first-block/\n│  ├── block.json // \u003e= 1.6.0\n│  ├── config.php\n│  └── markup.php\n├── second-block/\n    ├── block.json // \u003e= 1.6.0\n    ├── config.php\n    └── markup.php\n```\n\n```php\nuse ThemePlate\\Blocks\\CustomBlocks;\n\n( new CustomBlocks( 'My Blocks', '/path/to/blocks' ) )-\u003einit();\n\n/** \u003e= 1.6.0 */\n( new CustomBlocks( '/path/to/blocks' ) )-\u003einit()\n```\n\n#### */block/block.json\n```json\n{\n\t...\n\thttps://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/\n\t...\n}\n```\n\n#### */block/config.php\n```php\n\u003c?php\n\nuse ThemePlate\\Blocks\\BlockType;\n\nreturn ( new BlockType( 'My custom block' ) )-\u003efields( $list );\n\n/** \u003e= 1.6.0 */\nreturn array(\n\t...\n\t/** https://developer.wordpress.org/reference/classes/wp_block_type/__construct/#parameters */\n\t...\n);\n```\n\n#### */block/markup.php\n```php\n\u003c?php\n/**\n * @var array    $attributes Block attributes.\n * @var string   $content    Block inner content.\n * @var WP_Block $block      Block instance.\n */\n\n// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped\n?\u003e\n\n\u003cdiv \u003c?php echo get_block_wrapper_attributes(); ?\u003e\u003e\n\t\u003c?php echo $content; ?\u003e\n\n\t\u003cpre\u003e\u003c?php print_r( $attributes ); ?\u003e\u003c/pre\u003e\n\t\u003cpre\u003e\u003c?php print_r( $block ); ?\u003e\u003c/pre\u003e\n\u003c/div\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemeplate%2Fblocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemeplate%2Fblocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemeplate%2Fblocks/lists"}