PHPackages                             40q/acf-gutenberg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. 40q/acf-gutenberg

ActivePackage[Utility &amp; Helpers](/categories/utility)

40q/acf-gutenberg
=================

ACF Gutenberg

v3.0.2(5y ago)93.7k3MITPHPPHP ^7.3|^8.0

Since Jan 30Pushed 5y ago6 watchersCompare

[ Source](https://github.com/40Q/acf-gutenberg)[ Packagist](https://packagist.org/packages/40q/acf-gutenberg)[ RSS](/packages/40q-acf-gutenberg/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (34)Used By (0)

ACF Gutenberg
=============

[](#acf-gutenberg)

⚠️ **Attention‼️** If you were using this repo as a plugin please refer to version 1. This project is discontinued in favour of this composer package.

ACF Gutenberg is a composer package based on [Log1x ACF-Composer](https://github.com/Log1x/acf-composer) great project and [StoutLogic's ACF Builder](https://github.com/StoutLogic/acf-builder) with some adaptations to our own workflow:

- Use of section component as main wrapper for blocks.
- Block's slug use different logic.
- We include vars inside the view and we can call it without using the block object ($variable instead of $block-&gt;variable)
- Global options created by default.

Features
--------

[](#features)

- 🔥 Encourages clean structuring for creating fields with Sage 10 and ACF.
- 🔥 Instantly generate working fields, blocks, widgets, and option pages. Batteries included.
- 🔥 Instantly generate re-usable field group partials.
- 🔥 Blocks and widgets are fully rendered using Blade with a native Sage 10 feel for passing view data.
- 🔥 Blocks are automatically generated with `` support if [ACF v5.9.0+](https://www.advancedcustomfields.com/blog/acf-5-9-exciting-new-features/#InnerBlocks) is installed.
- 🔥 Automatically hooks widgets with `WP_Widget` making them instantly ready to use.
- 🔥 Automatically sets field location on blocks, widgets, and option pages.
- 🔥 Globally set default field type and field group settings. No more repeating `['ui' => 1]` on every select field.

Requirements
------------

[](#requirements)

- [Sage](https://github.com/roots/sage) &gt;= 10.0
- [ACF](https://www.advancedcustomfields.com/) &gt;= 5.8.0

Installation
------------

[](#installation)

Install via Composer:

```
$ composer require 40q/acf-composer
```

Usage
-----

[](#usage)

### Getting Started

[](#getting-started)

Start by publishing the `config/acf.php` configuration file using Acorn:

```
$ wp acorn vendor:publish --provider="AcfGutenberg\Providers\AcfComposerServiceProvider"
```

### Generating a Field

[](#generating-a-field)

To create your first field, start by running the following generator command from your theme directory:

```
$ wp acorn acf:field Example
```

This will create `src/Fields/Example.php` which is where you will create and manage your first field group.

Taking a glance at the generated `Example.php` stub, you will notice that it has a simple list configured.

```
