{"id":21989212,"url":"https://github.com/micropackage/acf-block-creator","last_synced_at":"2025-04-30T11:28:24.376Z","repository":{"id":57017021,"uuid":"236291796","full_name":"micropackage/acf-block-creator","owner":"micropackage","description":"ACF Block Creator - automatic Gutenberg block creation add-on for Advanced Custom Fields","archived":false,"fork":false,"pushed_at":"2022-03-17T08:54:57.000Z","size":2790,"stargazers_count":39,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-04-15T01:39:29.385Z","etag":null,"topics":["acf","acf-builder","bracketspace","composer-library","gutenberg","micropackage","wordpress"],"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/micropackage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-26T09:35:45.000Z","updated_at":"2025-01-03T15:24:11.000Z","dependencies_parsed_at":"2022-08-22T09:30:32.334Z","dependency_job_id":null,"html_url":"https://github.com/micropackage/acf-block-creator","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micropackage%2Facf-block-creator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micropackage%2Facf-block-creator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micropackage%2Facf-block-creator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micropackage%2Facf-block-creator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micropackage","download_url":"https://codeload.github.com/micropackage/acf-block-creator/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251690449,"owners_count":21628118,"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":["acf","acf-builder","bracketspace","composer-library","gutenberg","micropackage","wordpress"],"created_at":"2024-11-29T19:28:22.662Z","updated_at":"2025-04-30T11:28:24.321Z","avatar_url":"https://github.com/micropackage.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ACF Block Creator\n\n[![BracketSpace Micropackage](https://img.shields.io/badge/BracketSpace-Micropackage-brightgreen)](https://bracketspace.com)\n[![Latest Stable Version](https://poser.pugx.org/micropackage/acf-block-creator/v/stable)](https://packagist.org/packages/micropackage/acf-block-creator)\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/micropackage/acf-block-creator.svg)](https://packagist.org/packages/micropackage/acf-block-creator)\n[![Total Downloads](https://poser.pugx.org/micropackage/acf-block-creator/downloads)](https://packagist.org/packages/micropackage/acf-block-creator)\n[![License](https://poser.pugx.org/micropackage/acf-block-creator/license)](https://packagist.org/packages/micropackage/acf-block-creator)\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://bracketspace.com/extras/micropackage/micropackage-small.png\" alt=\"Micropackage logo\"/\u003e\n\u003c/p\u003e\n\n## 🧬 About ACF Block Creator\n\nThis package simplifies block creation for Gutengberg editor in WordPress using Advanced Custom Fields plugin.\nIt extends functonality of [Block Loader](https://github.com/micropackage/block-loader) package and is intended to use alongside it.\n\nThis package will automatically create a block template file with basic markup for ACF fields while creating a field group for a block.\n\n## 💾 Installation\n\n``` bash\ncomposer require --dev micropackage/acf-block-creator\n```\n\n## 🕹 Usage\n\nBefore you can start creating blocks this package needs to be initialized:\n```php\nMicropackage\\ACFBlockCreator\\ACFBlockCreator::init( [\n\t'blocks_dir'            =\u003e 'blocks',\n\t'scss_dir'              =\u003e false,\n\t'default_category'      =\u003e 'common',\n\t'block_container_class' =\u003e 'block-inner',\n\t'package'               =\u003e true,\n\t'license'               =\u003e 'GPL-3.0-or-later',\n] );\n```\n\nOnly thing to do is to create new ACF field group which name starts with \"Block:\". It will automatically create a block template file and set the field group location to this created block.\n\nBlock params (block name, slug, category etc.) can be adjusted using additional fields at the bottom of field group creation form.\n\n![ACF Block Creator demo](./.github/assets/usage-demo.gif?raw=true)\n\n### Silent initialization\n\nSince this is a development package and is not useful in production environment we probably don't want it's initialization code in the production package of our theme.\nThat's why this package will be automatically initialized by [Block Loader](https://github.com/micropackage/block-loader) if both packages will be present.\n\nSo if we will add this as dev dependency and then run `composer install --no-dev` this package will not be present and just won't get loaded by BlockLoader.\n\nAll configuration params of this package can be then passed directly to `BlockLoader::init` method.\n\nAlso `blocks_dir` param will not be necessary since it will automatically get the value of `dir` param for BlockLoader.\nIf you configure a custom category it will also be automatically used as default category for new blocks.\n\n## ⚙️ Configuration\nAll parameters are optional.\n\n| Parameter                 | Type              | Description                                                  |\n| ------------------------- | ----------------- | ------------------------------------------------------------ |\n| **blocks_dir**            | (*string*)        | Directory inside the theme for block templates.\u003cbr /\u003e**Default:** `'blocks'` |\n| **scss_dir**              | (*false\\|string*) | Directory inside the theme for block sass styles file.\u003cbr/\u003eIf set, the empty scss file will be created for each block in this directory.\u003cbr/\u003e**Default:** `false` |\n| **default_category**      | (*string*)        | Default category for new blocks.\u003cbr/\u003e**Default:** `'common'` |\n| **block_container_class** | (*string*)        | Optional class for wrapping `\u003cdiv\u003e` element inside the block template.\u003cbr/\u003e**Default:** `'block-inner'` |\n| **package**               | (*bool\\|string*)  | String containing package name for file block comment. If set to true, WordPress site name will be used. If false, no `@package` comment will be added.\u003cbr/\u003e**Default:** `true` |\n| **license**               | (*false\\|string*) | String containing license name for file block comment. If set to false no `@license` comment will be added.\u003cbr/\u003e**Default:** `'GPL-3.0-or-later'` |\n\n\n\n## 📦 About the Micropackage project\n\nMicropackages - as the name suggests - are micro packages with a tiny bit of reusable code, helpful particularly in WordPress development.\n\nThe aim is to have multiple packages which can be put together to create something bigger by defining only the structure.\n\nMicropackages are maintained by [BracketSpace](https://bracketspace.com).\n\n## 📖 Changelog\n\n[See the changelog file](./CHANGELOG.md).\n\n## 📃 License\n\nGNU General Public License (GPL) v3.0. See the [LICENSE](./LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicropackage%2Facf-block-creator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicropackage%2Facf-block-creator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicropackage%2Facf-block-creator/lists"}