PHPackages                             log1x/acf-composer - 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. log1x/acf-composer

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

log1x/acf-composer
==================

Create fields, blocks, option pages, and widgets using ACF Builder and Sage 10

v3.4.5(1mo ago)493760.2k—1.9%71[10 PRs](https://github.com/Log1x/acf-composer/pulls)11MITPHPPHP ^8.0CI passing

Since Sep 19Pushed 4mo ago17 watchersCompare

[ Source](https://github.com/Log1x/acf-composer)[ Packagist](https://packagist.org/packages/log1x/acf-composer)[ GitHub Sponsors](https://github.com/Log1x)[ RSS](/packages/log1x-acf-composer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (104)Used By (11)

ACF Composer
============

[](#acf-composer)

[![Latest Stable Version](https://camo.githubusercontent.com/7fe141d252d5a99517610b0469d01bd4559e9800a29f4462dd8c8d34f922818d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f6731782f6163662d636f6d706f7365722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/7fe141d252d5a99517610b0469d01bd4559e9800a29f4462dd8c8d34f922818d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f6731782f6163662d636f6d706f7365722e7376673f7374796c653d666c61742d737175617265)[![Total Downloads](https://camo.githubusercontent.com/3d0f78ad56a887d26ab58c001f31e59e25c1da07ade6a98feebb8d93daeb903e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6f6731782f6163662d636f6d706f7365722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/3d0f78ad56a887d26ab58c001f31e59e25c1da07ade6a98feebb8d93daeb903e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6f6731782f6163662d636f6d706f7365722e7376673f7374796c653d666c61742d737175617265)[![Build Status](https://camo.githubusercontent.com/196f26da43f09a6c6adce97a834c9dba5c73c854af63c6d70adfa459ac42faaf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6f6731782f6163662d636f6d706f7365722f6d61696e2e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/196f26da43f09a6c6adce97a834c9dba5c73c854af63c6d70adfa459ac42faaf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6f6731782f6163662d636f6d706f7365722f6d61696e2e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)

ACF Composer is the ultimate tool for creating fields, blocks, widgets, and option pages using [ACF Builder](https://github.com/stoutlogic/acf-builder) alongside [Sage 10](https://github.com/roots/sage).

[![Screenshot](https://camo.githubusercontent.com/23d7937ac792dc73bc4a67bebf7defab50c0669c412faaa0ca4f56f88af73a83/68747470733a2f2f692e696d6775722e636f6d2f376537773355392e706e67)](https://camo.githubusercontent.com/23d7937ac792dc73bc4a67bebf7defab50c0669c412faaa0ca4f56f88af73a83/68747470733a2f2f692e696d6775722e636f6d2f376537773355392e706e67)

Features
--------

[](#features)

- 🔧 Encourages clean structuring for creating fields with Sage 10 and ACF.
- 🚀 Instantly generate working fields, blocks, widgets, partials, and option pages using CLI. Batteries included.
- 🖼️ Fully rendered blocks and widgets using Blade with a native Sage 10 feel for passing view data.
- ⚡ Seamlessly [cache](#caching-blocks--fields) blocks to `block.json` and field groups to a manifest.
- 📦 Automatically hooks legacy widgets with `WP_Widget` making them instantly ready to use.
- 🛠️ Automatically sets field location on blocks, widgets, and option pages.
- 🌐 Globally define 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
- [Acorn](https://github.com/roots/acorn) &gt;= 3.0
- [ACF Pro](https://www.advancedcustomfields.com/) &gt;= 5.8.0

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

[](#installation)

Install via Composer:

```
$ composer require log1x/acf-composer
```

Usage
-----

[](#usage)

### Getting Started

[](#getting-started)

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

```
$ wp acorn vendor:publish --tag="acf-composer"
```

### Generating a Field Group

[](#generating-a-field-group)

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

```
$ wp acorn acf:field ExampleField
```

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

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

```
