ACF Layout Gen is command-line tool written in rust. It is designed to make the proccess creating layouts for ACF flexible content quick and easy by automatically generating the templates and populating them with the associated fields.
It takes the JSON file automatically generated by ACF, identifies the flex content fields and generates template-parts for the associated layouts.
The ACF Field Generator CLI is at tool for generating boilerplate PHP templates from a JSON representation created by Advanced Custom Fields (ACF).
...
Note: This tool is unofficial and not affiliated with Advanced Custom Fields (ACF)
...
-
JSON to PHP Conversion: Converts ACF field configurations stored in JSON format into corresponding wordpress boilerplate.
-
Automatic Flex Content Layouts Create the template parts for your layouts with all the fieldsin the right place.
-
Overwrite Flag Files will not be overwritten unless specified in the command
-
--src
,-s
: Path to the input JSON file containing ACF field configurations. -
--dest
,-d
: Path where the generated code will be created. -
--overwrite
,-o
: If true, existing files will be overwritten. False by default.
- clone repository
git clone [email protected]:willnjl/acf-layout-gen.git
- install executable (Unix)
cargo build && sudo cp target/debug/acf-layout-gen /usr/local/bin
- Run your Rust CLI app from anywhere on your machine.
acf-layout-gen --src inc/acf-json/group_654b6e4a8a06e.json --dest ./wp-content/themes/wordpress-theme
cargo watch -s 'cargo run -- --src "json/*.json" --dest ./output -o'