🩹 Fix block rendering compatibility with SCF#367
Open
adrianmomorales wants to merge 1 commit intoLog1x:masterfrom
Open
🩹 Fix block rendering compatibility with SCF#367adrianmomorales wants to merge 1 commit intoLog1x:masterfrom
adrianmomorales wants to merge 1 commit intoLog1x:masterfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
render_callbackfrom its internal block-types store, while ACF Pro reads it from the WordPress block registryrender_callback, SCF calls it directly — bypassing theacf_block_render_templateaction that acf-composer listens onrender_callbacktofalseandrender_templateto the block class name in the ACF store, so SCF falls through to therender_templatepath and fires the actionWhy
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_callbackpassed toregister_block_type()(which remainsacf_render_block_callback). This change is fully backwards-compatible.Test plan
🤖 Generated with Claude Code