Skip to content

🩹 Fix block rendering compatibility with SCF#367

Open
adrianmomorales wants to merge 1 commit intoLog1x:masterfrom
adrianmomorales:fix/scf-block-rendering-compat
Open

🩹 Fix block rendering compatibility with SCF#367
adrianmomorales wants to merge 1 commit intoLog1x:masterfrom
adrianmomorales:fix/scf-block-rendering-compat

Conversation

@adrianmomorales
Copy link
Copy Markdown

Summary

  • SCF reads render_callback from its internal block-types store, while ACF Pro reads it from the WordPress block registry
  • Since acf-composer stores a closure as render_callback, SCF calls it directly — bypassing the acf_block_render_template action that acf-composer listens on
  • This sets render_callback to false and render_template to the block class name in the ACF store, so SCF falls through to the render_template path and fires the action

Why

Secure Custom Fields (SCF) is the community fork of ACF after WP Engine acquired it. Projects migrating from ACF Pro to SCF find that custom blocks registered via acf-composer don't render — the editor shows an infinite spinner or a memory exhaustion error.

Backwards compatibility

ACF Pro ignores the store values and always uses the render_callback passed to register_block_type() (which remains acf_render_block_callback). This change is fully backwards-compatible.

Test plan

  • Verify blocks render correctly in the editor with ACF Pro
  • Verify blocks render correctly in the editor with SCF
  • Verify blocks render correctly on the frontend with both

🤖 Generated with Claude Code

SCF reads render_callback from its internal block-types store, while
ACF Pro reads it from the WordPress block registry. Since acf-composer
stores a closure as render_callback, SCF calls it directly — bypassing
the acf_block_render_template action that acf-composer listens on to
render blocks.

This sets render_callback to false and render_template to the block
class name in the ACF store, so SCF falls through to the render_template
path and fires the action. ACF Pro ignores the store values, so this
change is fully backwards-compatible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant