Open jl-a opened 1 year ago
I think, registering a block by register_block_type()
with the block_type name instead of the block.json file fails, because it requires an additional block javascript file including edit() and save() functions.
Therefore using the block.json path is recommended.
Issue
When running
register_block_type
with a PHP array of arguments instead of a path toblock.json
( i.e. using the$args
method, as described by the documentation), the ACF Gutenberg block is not visible on the frontend.(This is an issue for ACF Pro)
Steps to reproduce
With a fresh WordPress install, no plugins activated except ACF Pro, and a blank theme, if
functions.php
contains the following:the block is not available in the Gutenberg editor.
However if
functions.php
is changed toand a
block.json
file is created like so:the block is registered and is visible in the Gutenberg editor. This shows that registering the block with the PHP
$args
method does not work.Expected behaviour
Registering through
register_block_type
with the PHP$args
method should cause ACF blocks to be usable in the Gutenberg editor, the same as if theblock.json
method was used.I filed a support ticket and the response indicated that ACF is supposed to support the
$args
method so I believe this is a bug.Versions used