I am using the current version 7.2.7 and now wanted to add some custom blocks. The blocks are in a sub-folder of a plugin, the registration of the blocks is called from this plugin. I make the call as described in the documentation.
However, the blocks are not registered properly, because none of the blocks are displayed. Only when I make the link directly to one of the blocks, this – but just this – is registered and displayed.
I have no clue why but I got it working in the “wp-content/extensions/newsletter/blocks/” directory. But I would prefer to have the blocks within my own plugin.
Many thanks for your appriciated assistance.
Hi, the register block call needs a directory that contains a single block where there is the block.php file. You can call the register block as many times as the blocks you need to register.
There is a deprecated hook to register ALL blocks in a folder, it will be dismissed.