Skip to content

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

@CreativeDive

Description

@CreativeDive

Hello @lgladdy,

I read about it here: WordPress/gutenberg#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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions