AdvancedCustomFields / AdvancedCustomFields/acf

Can ACF support the native render callback in block.json?

Open
#730 19 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Hello @lgladdy,

I read about it here: https://github.com/WordPress/gutenberg/pull/42430

It seems that block.json supports a render callback by default.

src/block.json

{
    "name": "test/my-block",
    "render": "file:./render.php"
}

src/render.php

<div <?php echo get_block_wrapper_attributes(); ?>>
    <?php echo $attributes['text']; ?>
</div>

I'm wondering if we can use this render callback instead of ACF's own "renderTemplate": "index.php" in the future if ACF supports it?

Could this be a solution to make ACF block markup identical in editor and frontend? 👈 👈 👈

Have you ever been able to test whether this can replace the additional block wrapper?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the referenced Gutenberg render callback behavior alongside src/block.json and src/render.php, then trace how ACF applies renderTemplate and its additional block wrapper. Determine whether native rendering could replace that path while keeping editor and frontend markup identical; done means a documented, tested decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.