ACF Blocks Configuration via block.json


目录

Description

Since ACF 6.0, ACF has recommended using block.json to handle your block registration.

A mirror of the WordPress JSON Schema for block.json, with ACF’s additions, is available at https://github.com/AdvancedCustomFields/schemas/blob/main/json/block.json.

The WordPress documentation for block.json, describing all the core properties, is available here.

If your block.json contains an ACF key, it will be loaded by ACF as an ACF Block.

Block.json ACF Key

The ACF key supports the following properties:

Block.json Example

{
    "name": "acf/testimonial",
    "title": "Testimonial",
    "description": "A custom testimonial block that uses ACF fields.",
    "style": [ "file:./testimonial.css" ],
    "category": "formatting",
    "icon": "admin-comments",
    "keywords": ["testimonial", "quote"],
    "acf": {
        "mode": "preview",
        "renderTemplate": "testimonial.php",
        "validate": "false"
    },
    "supports": {
        "anchor": true
    }
}

版本号 #2
由 壳壳虫 创建于 2026-08-29 23:44:03 UTC
由 壳壳虫 更新于 2026-08-29 23:44:03 UTC